Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
  }
}
Source by livecodestream.dev #
 
PREVIOUS NEXT
Tagged: #Generate #random #Id #safely
ADD COMMENT
Topic
Name
3+4 =