Answers for "Generate a random Id safely"

0

Generate a random Id safely

export function calcId() {
  const array = new Uint32Array(8);
  self.crypto.getRandomValues(array);

  for (var i = 0; i < 1; i++) {
    const id = array[4];
    //console.log(id);
    return id;
  }
}
Posted by: Guest on April-09-2022

Code answers related to "Generate a random Id safely"

Code answers related to "Javascript"

Browse Popular Code Answers by Language