invalid_logic has asked for the wisdom of the Perl Monks concerning the following question:
I was able to get Digest::SHA working but it's returning gibberish. I'm not sure why. $data1 and $data2 are byte strings in hex. There is no '0x' preceeding the byte strings.
$digest = sha256_hex($data1 . $data2); $digest2 = sha256($data1 . $data2);
With '$digest' I get a valid result, but with 'digest2' I get gibberish.
print "This is a hexdigest->" . $digest, "\n"; print "This is a digest->" . $digest2, "\n"; This is a digest->��j6��Uϕ�&# +65533;Y�b�S�A��i�6�& +#1142;�,
What did I do wrong?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Digest sha256 returns gibberish
by Athanasius (Archbishop) on Aug 08, 2012 at 03:16 UTC | |
by invalid_logic (Initiate) on Aug 08, 2012 at 03:50 UTC | |
by Athanasius (Archbishop) on Aug 08, 2012 at 04:51 UTC | |
by invalid_logic (Initiate) on Aug 08, 2012 at 05:09 UTC | |
by aitap (Curate) on Aug 08, 2012 at 07:33 UTC |
Back to
Seekers of Perl Wisdom