mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
26 lines
378 B
JavaScript
26 lines
378 B
JavaScript
/**
|
|
* This function returns a random identifier.
|
|
* @returns
|
|
*/
|
|
const guidGenerator = () => {
|
|
var S4 = function () {
|
|
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
|
};
|
|
return (
|
|
S4() +
|
|
S4() +
|
|
"-" +
|
|
S4() +
|
|
"-" +
|
|
S4() +
|
|
"-" +
|
|
S4() +
|
|
"-" +
|
|
S4() +
|
|
S4() +
|
|
S4()
|
|
);
|
|
};
|
|
|
|
export default guidGenerator;
|