def fnv(data):
    """
    Fowler–Noll–Vo hash algorithm. 
    
    This algorithm is an efficient non-cryptographic hash function that is ideal 
    for hashing strings in such a way that speed is prioritized while minimising 
    collisions. Please node that on large vocab sets, collisions may occur.
    
    Args:
        data: byte type array or string
    
    Return: 
        32 bit hash value 
    
    See:
        https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
        
    Credit:
        https://github.com/znerol/py-fnvhash/blob/master/fnvhash/__init__.py
    """
    if not isinstance(data, bytes):
        data = str.encode(data)

    hval = 0
    for byte in data:
        hval = (hval * 0x100000001b3) % 2**32
        hval = hval ^ byte
    return hval