🔠 Converts a Uint8Array of bytes to a string.

Syntax

TypeScript
import { bytesToString } from '@opentf/std';

bytesToString(bytes: Uint8Array): string

Parameters

  • bytes: The byte array to convert.

Returns

The decoded string.

Examples

TypeScript
bytesToString(new Uint8Array([72, 101, 108, 108, 111])) //=> 'Hello'
Last updated on
Edit this page