You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A validation library is great for things that can vary widely like domains, emails, etc. But hashes and b64/58 encoding has to follow a certain format, so regex is that way to go imo.
Activity
[-]Add validation for hash[/-][+]Add validation for base64/ 52, sha256[/+][-]Add validation for base64/ 52, sha256[/-][+]Add validation for base64/ 58, sha256[/+]w4rc0n commentedon Mar 19, 2022
You can just use regex for these.
base64:
^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$base58:
^5[HJK][0-9A-Za-z&&[^0OIl]]{49}$sha256sum:
^[A-Fa-f0-9]{64}$In python:
A validation library is great for things that can vary widely like domains, emails, etc. But hashes and b64/58 encoding has to follow a certain format, so regex is that way to go imo.
Quix0r commentedon May 24, 2023
How about semantic version numbers?
maaaaz commentedon Nov 1, 2023
#313