UNPKG

time-uuid

Version:

Universally unique identifier in short web friendly (non UUID) format

19 lines (14 loc) 283 B
'use strict'; var now = require('microtime-x') , last = 0; module.exports = exports = function () { var time = now(); ++last; while (time <= last) ++time; last = time; return time; }; exports.increment = function () { if (last === 0) return exports(); return ++last; };