shorten is_valid_blobhash logic
This commit is contained in:
parent
229ed0d7dc
commit
01811621a6
1 changed files with 5 additions and 5 deletions
|
@ -49,14 +49,14 @@ def is_valid_hashcharacter(char):
|
||||||
|
|
||||||
|
|
||||||
def is_valid_blobhash(blobhash):
|
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
|
@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 len(blobhash) == blobhash_length and all(is_valid_hashcharacter(l) for l in blobhash)
|
||||||
return False
|
|
||||||
return all(is_valid_hashcharacter(l) for l in blobhash)
|
|
||||||
|
|
||||||
|
|
||||||
def version_is_greater_than(a, b):
|
def version_is_greater_than(a, b):
|
||||||
|
|
Loading…
Add table
Reference in a new issue