utc-random

Non-standard UUID generator

Usage no npm install needed!

<script type="module">
  import utcRandom from 'https://cdn.skypack.dev/utc-random';
</script>

README

Non-standard UUID generator

The UUIDs are 128 bits and are represented as 32 character hex strings. The first 14 hex characters are the number of microseconds since the Unix epoch, and the remaining 18 hex characters are random.

Usage

const utcr = require('utc-random');

// Call it directly
utcr((err, id) => {
  if (err) throw err;
  console.log(id);
});

// Or call the generate function
utcr.generate((err, id) => {
  if (err) throw err;
  console.log(id);
});