MCPcopy Create free account
hub / github.com/ccxt/ccxt / isHexString

Function isHexString

js/src/static_dependencies/ethers/utils/data.js:53–64  ·  view source on GitHub ↗
(value, length)

Source from the content-addressed store, hash-verified

51 * bytes of data (e.g. ``0x1234`` is 2 bytes).
52 */
53export function isHexString(value, length) {
54 if (typeof (value) !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
55 return false;
56 }
57 if (typeof (length) === "number" && value.length !== 2 + 2 * length) {
58 return false;
59 }
60 if (length === true && (value.length % 2) !== 0) {
61 return false;
62 }
63 return true;
64}
65/**
66 * Returns true if %%value%% is a valid representation of arbitrary
67 * data (i.e. a valid [[DataHexString]] or a Uint8Array).

Callers 15

#getFunctionMethod · 0.90
#getEventMethod · 0.90
getErrorMethod · 0.90
decodeEventLogMethod · 0.90
keccak256Function · 0.90
sha256Function · 0.90
resolveNamesMethod · 0.90
#getFunctionMethod · 0.90
#getEventMethod · 0.90
getErrorMethod · 0.90
decodeEventLogMethod · 0.90
keccak256Function · 0.90

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…