reorganize directory and file structure

This commit is contained in:
Joeri Exelmans 2025-05-07 13:44:49 +02:00
parent 1d826ea8d4
commit 48390b8556
99 changed files with 1155 additions and 1629 deletions

16
lib/util/random.js Normal file
View file

@ -0,0 +1,16 @@
// IMPURE
export const genUUID = (len=16) => {
const arr = crypto.getRandomValues(new Uint8Array(len));
let result = "";
for (let i=0; i<len; i++) {
const unsignedByte = arr[i];
if (unsignedByte < 16) {
result += '0' + unsignedByte.toString(16);
} else {
result += unsignedByte.toString(16);
}
}
return result;
};
console.log(genUUID())