Last active
December 18, 2015 13:59
-
-
Save wombleton/5793520 to your computer and use it in GitHub Desktop.
Node & command line differ in hash they return ... what am I doing wrong?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// \n at the end! | |
console.log(require('crypto').createHash('sha1').update('blob 14\0Hello, World!\n').digest('hex')); | |
$> 8ab686eafeb1f44702738c8b0f24f2567c36da6d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e 'blob 14\0Hello, World!' | shasum -a 1 | |
$> 8ab686eafeb1f44702738c8b0f24f2567c36da6d |
Yeah, as rcoup said:
$ echo -ne 'blob 14\0Hello, World!\n' | shasum -a 1
8ab686eafeb1f44702738c8b0f24f2567c36da6d -
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or
echo -ne ...