import hashlib


def strhash(text):
    """
    Get a number from 0 to 255 from the first byte of the SHA1 hash
    of a string.
    """
    hashobj = hashlib.sha1(text.encode('utf-8'))
    return hashobj.digest()[0]