code: function _getRandomData() {
    if (window && window.crypto && window.crypto.getRandomValues) {
      return crypto.getRandomValues(new Uint8Array(1))[0] % 16;
    } else {
      return Math.random() * 16;
    }
  }
docs: Returns random data using the Crypto API if available and Math.random if not
  Method is from https://gist.github.com/jed/982883 like generateUUID, direct link https://gist.github.com/jed/982883#gistcomment-45104