PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@polkadot/util/hex
Просмотр файла: hasPrefix.js
import { isHex } from '../is/hex.js';
/**
* @name hexHasPrefix
* @summary Tests for the existence of a `0x` prefix.
* @description
* Checks for a valid hex input value and if the start matched `0x`
* @example
* <BR>
*
* ```javascript
* import { hexHasPrefix } from '@polkadot/util';
*
* console.log('has prefix', hexHasPrefix('0x1234')); // => true
* ```
*/
export function hexHasPrefix(value) {
return !!value && isHex(value, -1);
}
Выполнить команду
Для локальной разработки. Не используйте в интернете!