API Reference / @evolu/common / Buffer / utf8ToBytes

Function: utf8ToBytes()

function utf8ToBytes(str): Uint8Array;

Defined in: node_modules/@noble/ciphers/esm/utils.d.ts:60

Converts string to bytes using UTF8 encoding.

Parameters

ParameterType
strstring

Returns

Uint8Array

Example

utf8ToBytes('abc') // new Uint8Array([97, 98, 99])

Was this page helpful?