Skip to content

Instantly share code, notes, and snippets.

@jammus
Created October 16, 2010 21:25
Show Gist options
  • Save jammus/630282 to your computer and use it in GitHub Desktop.
Save jammus/630282 to your computer and use it in GitHub Desktop.
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, 'utf8').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