Fix crypto lib call crash with custom function
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user