Fix crypto lib call crash with custom function

This commit is contained in:
softsimon committed 2024-07-21 22:54:58 +08:00
1 parent 8116b50d50
commit 743c7e8bfb
2 files changed
+16 -3

No files matched your search

+14 -1
View File
@@ -181,4 +181,17 @@ export function uncompressDeltaChange(delta: MempoolBlockDeltaCompressed): Mempo
acc: !!tx[3],
}))
};
}
}
export function simpleRandomUUID(): string {
const hexDigits = '0123456789abcdef';
const uuidLengths = [8, 4, 4, 4, 12];
let uuid = '';
for (const length of uuidLengths) {
for (let i = 0; i < length; i++) {
uuid += hexDigits[Math.floor(Math.random() * 16)];
}
uuid += '-';
}
return uuid.slice(0, -1);
}