export const uint128 = (guid: string) => {
const bytes = uuid.parse(guid);
let bi = 0n;
for (let i = 0; i < 16; i++) {
bi = (bi << 8n) | BigInt(bytes[i]);
}
console.log(bi);
return bi;
};
export const uint128ToUUID = (value: any) => {
const rb:any = [];
let bi = value;
for (let i = 0; i < 16; i++) {
rb.unshift(bi & 255n);
bi >>= 8n;
}
const guid = uuid.stringify(rb);
console.log(guid);
return guid;
};