2
当我从http://ruby.about.com/od/advancedruby/ss/Cryptographic-Hashes-In-Ruby.htm为什么我得到一个除我期望的哈希以外的哈希?
#!/usr/bin/env ruby
require 'digest'
password = "A user's password"
hash = Digest::SHA1.hexdigest(password)
puts hash
# This will produce the hash
# 62018390552aaba3d344e3b43bfa14e49e535dfc
中输入验证码,我得到他们说我愿意回答。
但是,当我进入这个shell命令
echo "A user's password" | openssl dgst -sha1 -hex
我得到95f33732bafc1744bf24e0cae4e014ab2e5f1580
为什么,好吗?
明白了。谢谢。 – cdnbcguy
很高兴帮助 - 随时接受这个答案。 ;-) – GargantuChet