1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.stringToHex = void 0;
|
4 | const toHex_js_1 = require("../u8a/toHex.js");
|
5 | const toU8a_js_1 = require("./toU8a.js");
|
6 | /**
|
7 | * @name stringToHex
|
8 | * @summary Creates a hex string from a utf-8 string
|
9 | * @description
|
10 | * String input values return the actual encoded hex value.
|
11 | * @example
|
12 | * <BR>
|
13 | *
|
14 | * ```javascript
|
15 | * import { stringToHex } from '@polkadot/util';
|
16 | *
|
17 | * stringToU8a('hello'); // 0x68656c6c6f
|
18 | * ```
|
19 | */
|
20 | function stringToHex(value) {
|
21 | return (0, toHex_js_1.u8aToHex)((0, toU8a_js_1.stringToU8a)(value));
|
22 | }
|
23 | exports.stringToHex = stringToHex;
|