Navigation Menu

Skip to content

Commit

Permalink
Generate new id correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 9, 2012
1 parent f142adc commit 64b3e28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/database/domain.js
Expand Up @@ -131,7 +131,7 @@ Domain.prototype = {
createNewId: function() {
var size = 26;
var characters = '0123456789abcdefghijklmnopqrstuvwxyz'.split('');
var lastIndex = characters.length;
var lastIndex = characters.length - 1;
var id = '';
while (id.length < size) {
id += characters[Math.round(Math.random() * lastIndex)];
Expand Down

0 comments on commit 64b3e28

Please sign in to comment.