Echo JS 0.11.0

<~>

tracker1 2017 days ago. link 1 point
IE11 support...

    function createUUID() {
      var fmt = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
      var rnd = Array.from((window.crypto || window.msCrypto).getRandomValues(new Uint8Array(32))).map(function(n){ return n&0xf });
      function rk(c,r) {return (c == 'x' ? r : (r&0x3|0x8)).toString(16); };
      return fmt.replace(/[xy]/g, function(c) { return rk(c, rnd.pop()); });
    }
jklu 2016 days ago. link 1 point
NodeJS support...

const crypto = require("crypto");
function createUUID() {
  const fmt = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
  const rnd = Array.from(crypto.randomBytes(32)).map(n => n & 0xf);
  const rk = (c, r) => (c == "x" ? r : (r & 0x3) | 0x8).toString(16);
  return fmt.replace(/[xy]/g, c => rk(c, rnd.pop()));
}