calcSizeHex

import { calcSizeHex } from "jsr:@ende/encoding/unstable-hex";

function ยท experimental

function calcSizeHex(originalSize: number): number

Calculate the output size needed to encode a given input size for encodeIntoHex.

originalSize: number

The size of the input buffer.

Returns

The size of the output buffer.

Example: Basic Usage

import { assertEquals } from "@ende/assert";
import { calcSizeHex } from "@ende/encoding/unstable-hex";

assertEquals(calcSizeHex(1), 2);

Source