random-uniq.js 207 B

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