shorten is_valid_blobhash logic

This commit is contained in:
Job Evers-Meltzer 2016-10-18 17:25:16 -05:00
parent 229ed0d7dc
commit 01811621a6

View file

@ -49,14 +49,14 @@ def is_valid_hashcharacter(char):
def is_valid_blobhash(blobhash):
"""
"""Checks whether the blobhash is the correct length and contains only
valid characters (0-9, a-f)
@param blobhash: string, the blobhash to check
@return: Whether the blobhash is the correct length and contains only valid characters (0-9, a-f)
@return: True/False
"""
if len(blobhash) != blobhash_length:
return False
return all(is_valid_hashcharacter(l) for l in blobhash)
return len(blobhash) == blobhash_length and all(is_valid_hashcharacter(l) for l in blobhash)
def version_is_greater_than(a, b):