Added a very complicated AsyncIterableReader class.

The class was already implemented in
"https://deno.land/std@0.144.0/streams/conversion.ts".  So, I litterally
lost 1 day of work!  I hate myself.
This commit is contained in:
didier amyot committed 2023-06-12 12:02:15 -04:00
1 parent 17a1b4bed3
commit 0d627c9051
125 files changed
+26943 -83

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.
/**
* Slice number into 64bit big endian byte array
* @param d The number to be sliced
* @param dest The sliced array
*/
export function sliceLongToBytes(
d: number,
dest = Array.from<number>({ length: 8 }),
): number[] {
let big = BigInt(d);
for (let i = 0; i < 8; i++) {
dest[7 - i] = Number(big & 0xffn);
big >>= 8n;
}
return dest;
}