UNPKG

422 BTypeScriptView Raw
1import type { AnyString, HexString } from '../types.js';
2/**
3 * @name stringToHex
4 * @summary Creates a hex string from a utf-8 string
5 * @description
6 * String input values return the actual encoded hex value.
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import { stringToHex } from '@polkadot/util';
12 *
13 * stringToU8a('hello'); // 0x68656c6c6f
14 * ```
15 */
16export declare function stringToHex(value?: AnyString): HexString;