Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/bencodex/src/encoder.ts>encodeKeyInto

An alternative take on implementing Bencodex in TypeScript/JavaScript
Latest
function encodeKeyInto
import { encodeKeyInto } from "https://deno.land/x/bencodex@0.2.2/src/encoder.ts";

Encodes a key into the given buffer.

Parameters

key: Key

A key to encode.

buffer: Uint8Array

A buffer that the encoded key will be written into. This buffer will be modified.

optional
options: NonAllocEncodingOptions = [UNSUPPORTED]

Encoding options.

Returns

The object which indicates the number of bytes written into the buffer and whether the encoding is complete.