UNPKG

542 BTypeScriptView Raw
1/// <reference types="node" />
2/**
3 * @name u8aToBuffer
4 * @summary Creates a Buffer object from a hex string.
5 * @description
6 * `null` inputs returns an empty `Buffer` result. `UInt8Array` input values return the actual bytes value converted to a `Buffer`. Anything that is not a `UInt8Array` throws an error.
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import { u8aToBuffer } from '@polkadot/util';
12 *
13 * console.log('Buffer', u8aToBuffer('0x123480001f'));
14 * ```
15 */
16export declare function u8aToBuffer(value?: Uint8Array | null): Buffer;