Created
October 16, 2010 21:07
-
-
Save jammus/630261 to your computer and use it in GitHub Desktop.
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
var assert = require("assert"); | |
var ntest = require("ntest"); | |
var hashlib = require("hashlib"); | |
var crypto = require("crypto"); | |
ntest.describe("Crypto and Hashlib md5 hashes") | |
ntest.it("give same result for high characters", function() { | |
var trackname = "Tony’s Theme (Remastered)"; | |
var cryptoHash = crypto.createHash("md5").update(trackname).digest("hex"); | |
var hashlibHash = hashlib.md5(trackname); | |
assert.equal(cryptoHash, hashlibHash); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output is:
TEST: Crypto and Hashlib md5 hashes give same result for high characters
AssertionError: "3bb37785865d7bc358729d0f9b773eae" == "27b8d7c08b2b6f5cbfcfff0c386bf9ff"
at Object. (cryptoVhashlib.js:11:12)
at [object Object].runTest (/usr/local/lib/node/ntest/index.js:153:14)
at [object Object].run (/usr/local/lib/node/ntest/index.js:171:21)
at [object Object].test (/usr/local/lib/node/ntest/index.js:132:9)
at Object. (/usr/local/lib/node/ntest/index.js:23:44)
at Object. (cryptoVhashlib.js:7:9)
at Module._compile (node.js:461:23)
at Module._loadScriptSync (node.js:468:10)
at Module.loadSync (node.js:338:12)
at loadModule (node.js:283:14)