@staticmethod
def is_sha1(h):
    """
        Ensure h is a syntactically correct SHA1 hash in hexadecimal
        """
    if len(h) != 40:
        return False
    try:
        int(h, 16)
    except ValueError:
        return False
    return True
