This may be a hash derived from sha1, which is widely used:
From the PHP documentation :
If the raw_output option is set to TRUE, then instead of sha1 digest, a raw binary format of 20 is returned, otherwise the return value will be a hexadecimal number of 40 characters.
echo (sha1("whatever"));
Please note that this is not the case, as there are many other hashing algorithms that will give you a length of 40 characters:
echo (hash("ripemd160", "whatever")); echo (hash("tiger160,3", "whatever")); echo (hash("tiger160,4", "whatever")); echo (hash("haval160,3", "whatever")); echo (hash("haval160,4", "whatever")); echo (hash("haval160,5", "whatever"));
source share