(function testRegular() { var PASS = '******', STAGE_1 = auth.sha1(PASS), TOKEN = auth.xor( auth.sha1(new Buffer(SCRAMBLE + auth.sha1(STAGE_1), 'binary')), STAGE_1 ); assert.deepEqual(auth.token('root', SCRAMBLE), TOKEN); })();
(function testNoPassword() { assert.deepEqual(auth.token(null, SCRAMBLE), new Buffer(0)); })();