sha1
-
We use the
Digest::SHA1class to build the equivalent cryptographic hash to PHP’ssha1function. This works the same as theDigest::MD5class mentioned in md5, and needs to require theDigestlibrary usingrequire "digest".PHP
print sha1("my string"); // => e19343e6c6c76f8f634a685eba7c0880648b1389
Ruby
require "digest" print Digest::SHA1.hexdigest("my string") # => e19343e6c6c76f8f634a685eba7c0880648b1389
see also
Looking for Rails or PHP web application development, integration, and training?
Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.

