Vanilla_Fury

Uuid generator

Sep 19th, 2022
1,149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.17 KB | Source Code | 0 0
  1. function uuidv4() {
  2.   return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
  3.     (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
  4.   );
  5. }
Advertisement
Add Comment
Please, Sign In to add comment