def hash_func(name):
    """Hash the string using a hash algorithm found in
    tombkeeper/Shellcode_Template_in_C.
    """
    ret = 0
    for char in name:
        ret = ((ret << 5) + ret + ord(char)) & 0xffffffff
    return hex(ret)