840 B
840 B
Functions
isHex
▸ isHex(value: any, bitLength?: number, ignoreLength?: boolean): boolean
Defined in is/hex.ts:24
name: isHex
summary: Tests for a hex string.
description: Checks to see if the input value is a 0x prefixed hex string. Optionally (bitLength !== -1) checks to see if the bitLength is correct.
example:
import { isHex } from '@polkadot/util';
isHex('0x1234'); // => true
isHex('0x1234', 8); // => false
Parameters:
| Name | Type | Default value |
|---|---|---|
| value | any |
- |
Default value bitLength |
number |
-1 |
Default value ignoreLength |
boolean |
false |
Returns: boolean