Moved applet-core functionalities to individual libs, Updated UUID and IBAN generators
Update iban-generator.mjs, uuid-generator.mjs, and 4 more files...
This commit is contained in:
14
static/resources/NibblePoker/libs/uuid.mjs
Normal file
14
static/resources/NibblePoker/libs/uuid.mjs
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generates a random UUID4 and returns its string representation
|
||||
* @returns {`${string}-${string}-${string}-${string}-${string}`}
|
||||
*/
|
||||
export function generateUUID4(addHyphens, addGuidBrackets) {
|
||||
let uuid4 = crypto.randomUUID();
|
||||
if(!addHyphens) {
|
||||
uuid4 = uuid4.replace(/-/g, "");
|
||||
}
|
||||
if(addGuidBrackets) {
|
||||
uuid4 = "{" + uuid4 + "}";
|
||||
}
|
||||
return uuid4;
|
||||
}
|
Reference in New Issue
Block a user