Use random hex string instead of uuid for nonce

This commit is contained in:
Tankred Hase
2016-06-10 10:44:26 +02:00
parent 9cdbfeae87
commit 405bb84ca6
5 changed files with 29 additions and 8 deletions

View File

@@ -125,6 +125,16 @@ describe('Util Unit Tests', () => {
});
});
describe('random', () => {
it('should generate random 32 char hex string', () => {
expect(util.random().length).to.equal(32);
});
it('should generate random 16 char hex string', () => {
expect(util.random(8).length).to.equal(16);
});
});
describe('getOrigin', () => {
it('should work', () => {
expect(util.getOrigin({host:'h', protocol:'p'})).to.exist;