UNPKG

time-uuid

Version:

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

12 lines (9 loc) 253 B
'use strict'; var now = require('microtime-x'); module.exports = function (t, a) { var time; a(typeof t(now()), 'string', "Type"); a(/^\d[a-z0-9]+$/.test(now()), true, "Format"); time = now(); a(t(time), t(time), "Same time returns same ID"); };