説明なし

uuid.js 214B

1234567
  1. export default function getUUID() {
  2. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  3. let r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
  4. return v.toString(16);
  5. });
  6. }