commit
This commit is contained in:
commit
b5ca2d50ac
337 changed files with 24672 additions and 0 deletions
17
dist/uuid.js
vendored
Normal file
17
dist/uuid.js
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.uuid = void 0;
|
||||
//Gerar uma uuid V4
|
||||
const letras = "0123456789abcdef".split("");
|
||||
const uuid = () => {
|
||||
letras.sort(() => Math.random() - 0.5);
|
||||
const modelo = "xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx".split("");
|
||||
const retorno = modelo
|
||||
.map((letra) => letra === "x"
|
||||
? letras[((1000 * Math.random()) | 0) % letras.length]
|
||||
: letra)
|
||||
.join("");
|
||||
return retorno;
|
||||
};
|
||||
exports.uuid = uuid;
|
||||
//# sourceMappingURL=uuid.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue