Make IDs *always* 16 characters
This commit is contained in:
parent
8f513dfe3c
commit
9b3f7a3f38
@ -22,7 +22,7 @@ var util = {
|
||||
return dest;
|
||||
},
|
||||
randomId: function () {
|
||||
return Math.random().toString(36).substr(2);
|
||||
return (Math.random().toString(36) + '0000000000000000000').substr(2, 16);
|
||||
},
|
||||
prettyError: function (msg) {
|
||||
if (util.debug) {
|
||||
|
@ -206,7 +206,7 @@ describe('PeerServer', function() {
|
||||
});
|
||||
|
||||
it('should generate a 16-character ID', function() {
|
||||
expect(p._generateClientId('anykey').length).to.be.within(15, 16);
|
||||
expect(p._generateClientId('anykey').length).to.be(16);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user