From e4f731a4d18f9e76b294eaaaeb94d9b4aa1041c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20K=C5=82eczek?= Date: Wed, 30 Oct 2019 11:15:12 +0100 Subject: [PATCH] Add password hash test case --- test/test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test.js b/test/test.js index d8a7797..d9210c9 100644 --- a/test/test.js +++ b/test/test.js @@ -57,6 +57,17 @@ describe('Ambisafe', function () { }); })); }); + + it('should hash password', () => { + var password = 'test', + hashedPassword = Ambisafe.deriveKey( + password, + Ambisafe.SHA1(password), + 2000 + ); + + assert.equal(hashedPassword, 'e315febdd169b000d04b5813091c0ca7e976eb6e3d7561f3fa890fdfe28df943'); + }); }); describe('Ambisafe.Account', function () {