[WIP] Security work While on holiday
This commit is contained in:
parent
a81ac4efca
commit
7f0231e3f1
109 changed files with 19694 additions and 5210 deletions
|
|
@ -13,6 +13,11 @@ export function utf8Encode(text: string): Uint8Array {
|
|||
return bytes.subarray(0, len);
|
||||
}
|
||||
|
||||
/** Return the current Unix time in milliseconds for MTP protocol fields. */
|
||||
export function unixTimeMillis(): bigint {
|
||||
return BigInt(Date.now());
|
||||
}
|
||||
|
||||
export function writeU64BE(value: bigint): Uint8Array {
|
||||
if (value < 0n || value > 0xffff_ffff_ffff_ffffn) throw new Error("u64 value out of range");
|
||||
const out = new Uint8Array(8);
|
||||
|
|
|
|||
Loading…
Reference in a new issue