Some sugar like this would be really sweet:
Digest::MD5::LENGTH #=> 256
Digest::length(:MD5) #=> 256
Digest::MD5.digest('secret', :salt => 'mysalt')
The following would auto-generate a random salt of the optimal length
(which should be same as the hash , i.e. Digest::MD5::LENGTH bits)
Digest::MD5.dgest('secret', :salt => :auto)
Is there some interest in such feature? In such case, I would like to
write/contribute the code and I will report here about any progress.
Regards,
Guido
_______________________________________________
facets-universal mailing list
facets-u...@rubyforge.org
http://rubyforge.org/mailman/listinfo/facets-universal
It's basically a standard library extension from one of my own
projects, but all the logic might be easily extracted and put into
Facets...
You may write something like
Digest::SHA1.salted_base64digest('secret', 'salt')
or even
Digest::SHA1.salted_base64digest('secret')
with a salt auto-generated,