Skip to content

Commit

Permalink
get_uuids: Make the ids more similar to the sequential algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-l committed May 9, 2015
1 parent 7f79ee3 commit 8942a2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/get_uuids.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ module.exports = function (self) {
* GET method used to show a generate one or more UUIDs
*/
return function (req, res) {
var count, ret, i;
var count, ret, i, seqPrefix;

count = req.params.count || 1;

ret = [];

seqPrefix = self.seqPrefix || '4e17c12963f4bee0e6ec90da54';
for (i = 0; i < count; i += 1) {
ret.push(i);
ret.push(seqPrefix + ('000000' + i).substr(-6, 6));
}

res.send(200, {'uuids': ret});
Expand Down

0 comments on commit 8942a2a

Please sign in to comment.