JSFiddle - React, Tailwind, and code Playground

by MegaScience

JavaScript

const createGenerator = function() {
  var a = 0,
    b = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
  const res = function(c, d) {
    function i(a, c) {
      var d = '',
        e;
      while (a > 0) e = Math.floor(a / c), d = b[a - c * e] + d, a = e;
      return d || '0'
    }

    function j(a, b) {
      while (a.length < b) a = '0' + a;
      return a
    }
    var e = d ? 10 : 62,
      f = 0,
      g = (new Date).getTime(),
      h = c === 3 ? 230000 : c === 4 ? 14000000 : c === 5 ? 910000000 : c === 6 ? 56000000000 : 3500000000000;
    return c = c > 2 && c < 8 ? c : 7,
      f === g ? a++ : (a = 0, f = g),
      j(i(g % h, e), c) + i(a)
  }
  return res
}
const sluid = createGenerator()
const results = () => {
	let txt = []
  for(let i = 3; i <= 7; i++)
		txt.push(`i = ${i} | b = ${false} = ${sluid(i, false)} || b = ${true} = ${sluid(i, true)}`)
  return txt
}

document.body.innerHTML = results().join('<br>')