MCPcopy Create free account
hub / github.com/Kong/insomnia / utf8BytesFromString

Function utf8BytesFromString

packages/insomnia/src/common/utils/utf8-bytes.ts:3–5  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

1const BASE64_CHUNK_SIZE = 0x80_00;
2
3export function utf8BytesFromString(value: string): Uint8Array {
4 return new TextEncoder().encode(value);
5}
6
7export function utf8ByteLength(value: string): number {
8 return utf8BytesFromString(value).length;

Callers 2

utf8ByteLengthFunction · 0.85
utf8ToBase64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected