import { DecryptLengthDelimitStream } from "https://deno.land/x/earthstar@v10.2.2/src/syncer/message_crypto.ts";
Given a stream of potentially multiple and / or truncated chunks with an encrypted length delimiter, finds encrypted length delimiters and uses that to enqueue discrete chunks
Constructors
new
DecryptLengthDelimitStream(derivedKey: CryptoKey)Properties
private
derivedKey: CryptoKeyprivate
transform: TransformStream<Uint8Array, Uint8Array>readable: ReadableStream<Uint8Array>
writable: WritableStream<Uint8Array>
Methods
private
delimit(newBytes: Uint8Array,
carryOver: UnfinishedLength | UnfinishedMessage | null,
enqueue: (bytes: Uint8Array) => void,
private
getCarryOver()private
getLength(bytes: Uint8Array): Promise<{ length: number; leftover: Uint8Array; } | false>private
setCarryOver(carryOver: UnfinishedLength | UnfinishedMessage | null)