Files
discord-decomp/_bundle/Module1290.js
T
2026-11-01 12:12:55 +02:00

23 lines
918 B
JavaScript

// Metro module 1290 (f1291).
import { hash } from "./XXH64";
let c1061_2, c1061_3;
export function runtimeHashMessageKey(a0) {
let r0 = 0;
const r11 = BigInt(hash(a0, 0));
const r27 = [];
const r33 = Math.ceil(Math.floor(Math.log2(Number(r11)) + 1) / 8);
if (0 < r33) {
do {
r27.unshift(Number(r11 >> BigInt(8 * r0) & BigInt(255)));
r0 = r0 + 1;
} while (r0 < r33);
}
const uint8Array = new Uint8Array(r27);
const r50 = c1061_3 ? uint8Array : uint8Array.reverse();
return [c1061_2[r50[0] >> 2], c1061_2[(3 & r50[0]) << 4 | r50[1] >> 4], c1061_2[(15 & r50[1]) << 2 | r50[2] >> 6], c1061_2[63 & r50[2]], c1061_2[r50[3] >> 2], c1061_2[(3 & r50[3]) << 4 | r50[4] >> 4]].join("");
}
c1061_2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
const uint8Array = new Uint8Array(4);
new Uint32Array(uint8Array.buffer)[0] = 1;
c1061_3 = !(1 & uint8Array[0]);