Recently programming in PHP, I thought I had a working Perl regular expression but when I checked it against what I wanted, it didn’t work.
What is the right expression to check if something is a MD5 has (32 digit hexadecimal of a-z and 0-9).
Currently, I have /^[a-z0-9]{32}$/i
MD5:
SHA-1:
MD5 or SHA-1:
Also, most hashes are always presented in a lowercase hexadecimal way, so you might wanna consider dropping the
imodifier.By the way, hexadecimal means base 16:
So as you can see it only goes from 0 to F, the same way decimal (or base 10) only goes from 0 to 9.