import hashlib
from re import M


def hash_key(integer):
    """Hash the given integers and trim to l digits
    
    Arguments:
        integer {Integer}
    
    Returns:
        Integer -- Hashed Integer Value
    """
    name = str(integer)
    m = hashlib.sha1(name.encode('utf-8'))
    key_hash = m.hexdigest()[:M // 4]
    return int(key_hash, 16)