mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-22 20:44:55 +00:00
validation.py: check for passing b32 address instead of base64 hash
This commit is contained in:
parent
0cd7556774
commit
ac349547f5
@ -63,6 +63,9 @@ def validate_b64hash(data, check_uniq=True):
|
||||
# strip leading and trailing whitespaces
|
||||
data = data.strip()
|
||||
length = len(data)
|
||||
# check for b32 address misuse
|
||||
if re.match(r'.*\.b32\.i2p$', data):
|
||||
raise forms.ValidationError('You should paste base64 hash, not a base32!')
|
||||
# Minimum key length 516 bytes
|
||||
if length < 516:
|
||||
raise forms.ValidationError('Specified base64 hash are less than 516 bytes')
|
||||
|
Loading…
x
Reference in New Issue
Block a user