Merge branch 'master' into nymkappa/apple-pay

This commit is contained in:
nymkappa
2024-07-24 22:04:44 +02:00
32 changed files with 1111 additions and 925 deletions

View File

@@ -183,6 +183,19 @@ export function uncompressDeltaChange(delta: MempoolBlockDeltaCompressed): Mempo
};
}
export function insecureRandomUUID(): 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);
}
// https://stackoverflow.com/a/60467595
export function md5(inputString): string {
var hc="0123456789abcdef";
@@ -225,4 +238,4 @@ export function md5(inputString): string {
b=ii(b,c,d,a,x[i+ 9],21, -343485551);a=ad(a,olda);b=ad(b,oldb);c=ad(c,oldc);d=ad(d,oldd);
}
return rh(a)+rh(b)+rh(c)+rh(d);
}
}