UNPKG

473 BTypeScriptView Raw
1/**
2 * @name u8aToString
3 * @summary Creates a utf-8 string from a Uint8Array object.
4 * @description
5 * `UInt8Array` input values return the actual decoded utf-8 string. `null` or `undefined` values returns an empty string.
6 * @example
7 * <BR>
8 *
9 * ```javascript
10 * import { u8aToString } from '@polkadot/util';
11 *
12 * u8aToString(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0x6f])); // hello
13 * ```
14 */
15export declare function u8aToString(value?: Uint8Array | null): string;