random-uniq.js 206 B

1234567891011
  1. 'use strict';
  2. var generated = Object.create(null)
  3. , random = Math.random;
  4. module.exports = function () {
  5. var str;
  6. do { str = random().toString(36).slice(2); } while (generated[str]);
  7. return str;
  8. };