I'm having problems with hash encoding in Perl. I've narrowed it down to the following code which seems to be giving me the wrong result
#!/usr/bin/perl use warnings; use strict; use Digest::SHA qw(sha256 sha256_hex); my $digest=sha256_hex("138539083512345apiKeyDEMO","apiSecretDEMO" ); print "Digest=$digest\n"; # correct answer is: #696E087F4B1902AA58D35E75B4600580D70A92ED68B23379373117FB3FE3064A # my code generates: #ea645ae07e04289f3fe14c81af54f7da9cae1114fe2bb9efbb6b383ef276434b
I've included what the answer should be at the bottom. I've checked the answer at http://hash.online-convert.com/sha256-generator and it confirms the correct figure. Why is my code generating the wrong answer?
In reply to Problems with HMAC SHA-256 by agnome
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |