I am using hashlib library in python and Digest::SHA256.hexdigest library in ruby
With python I tried,
import hashlib
hasher = hashlib.sha256()
hasher.update("xyz")
hasher.digest()
hash = hasher.hexdigest()
print hash
output : 3608bca1e44ea6c4d268eb6db02260269892c0b42b86bbf1e77a6fa16c3c9282
With Ruby I tried,
require 'digest'
hasher = Digest::SHA256.digest "xyz"
hash = Digest::SHA256.hexdigest(hasher)
output : "18cefdae0f25ad7bb5f3934634513e54e5ac56d9891eb13ce456d3eb1f3e72e8"
Can anyone help me to understand why there is a difference? how can I get the same value as python ?