Can only hash strings and not integers
GoogleCodeExporter opened this issue · comments
Google Code Exporter commented
1). What steps will reproduce the problem?
var number = 11111;
var string = number.toString();
var actual = CryptoJS.SHA256("11111");
var hash1 = CryptoJS.SHA256(number);
var result1 = CryptoJS.SHA256(string);
2.) What is the expected output? What do you see instead?
hash1 is undefined but result1 produces a hash. result1 == actual.
3) What version of the product are you using? On what operating system?
CryptoJS 3.0.1
Firefox 23.0.1
Arch Linux x86_64 kernel: 3.10.10-1-ARCH
4). Please provide any additional information below.
If this is not a bug please make it clearer in the documentation that
passing a straight number to a hashing function will return undefined.
Original issue reported on code.google.com by benjamin...@gmail.com
on 9 Sep 2013 at 11:54
Google Code Exporter commented
In the section The_Hasher_Input
(https://code.google.com/p/crypto-js/#The_Hasher_Input) it says that "The hash
algorithms accept either strings or instances of CryptoJS.lib.WordArray."
Original comment by Jeff.Mott.OR
on 9 Sep 2013 at 11:58
- Changed state: Invalid
Google Code Exporter commented
My apologies for overlooking this. Feel incredibly stupid now.
Original comment by benjamin...@gmail.com
on 10 Sep 2013 at 12:05
Google Code Exporter commented
No worries.
Original comment by Jeff.Mott.OR
on 10 Sep 2013 at 12:06