import hashlib


def make_hash_bytes(data, length=20):
    """
    Creates a hash of length *length*.
    """
    m = hashlib.sha256()
    m.update(data)
    res = m.hexdigest()[:length]
    return res