UNPKG

libc-crypt

Version:

A JavaScript implementation of the Unix libc crypt

15 lines (13 loc) 496 B
var Crypt = require('../lib/crypt'); module.exports = { testMd5Password: function (test) { var crypted = Crypt.crypt("123456", "$1$abcdefgh$"); test.equals("$1$abcdefgh$KJHEbEnUJaxWv269o9nH60", crypted, "not a md5 password"); test.done(); }, testUnixPassword: function (test) { var crypted = Crypt.crypt("validPass", "B5xBYM2HbnPqI"); test.equal(crypted, "B5xBYM2HbnPqI", "not a unix password"); test.done(); }, }