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

x/bencodex/src/encoder.ts>estimateKeySize

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

Estimates the byte size of the given key in Bencodex. It enables you to determine the size of a Bencodex data without actually encoding it.

Parameters

key: Key

A Bencodex dictionary key to estimate the size.

optional
options: SizeEstimationOptions = [UNSUPPORTED]

Options for size estimation.

Returns

number

The estimated byte size of the given key.