@xylabs/hex
Advanced tools
Comparing version 4.0.3 to 4.0.4
@@ -1,52 +0,4 @@ | ||
type AssertCallback = (value: unknown, message: string) => string | boolean; | ||
type AssertConfig = string | AssertCallback | boolean; | ||
type Hex = Exclude<Lowercase<string>, 'reserved-hex-value'>; | ||
interface HexConfig { | ||
bitLength?: number; | ||
byteSize?: number; | ||
prefix?: boolean; | ||
} | ||
declare function asHex(value: unknown): Hex | undefined; | ||
declare function asHex(value: unknown, assert: AssertConfig): Hex; | ||
declare const hexFrom: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Hex; | ||
declare const hexFromArrayBuffer: (buffer: ArrayBuffer, config?: HexConfig) => Hex; | ||
declare const hexFromBigInt: (value: bigint, config?: HexConfig) => Hex; | ||
declare const hexFromHexString: (value: string, config?: HexConfig) => Hex; | ||
declare const hexFromNumber: (value: number, config?: HexConfig) => Hex; | ||
declare const isHex: (value: unknown, config?: HexConfig) => value is Hex; | ||
declare const isHexZero: (value?: string) => boolean | undefined; | ||
declare const toHexLegacy: (buffer: ArrayBuffer) => string; | ||
declare const bitsToNibbles: (value: number) => number; | ||
declare const nibblesToBits: (value: number) => number; | ||
declare const hexRegex: RegExp; | ||
declare const hexRegexWithPrefix: RegExp; | ||
declare const toHex: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>; | ||
type Address = Exclude<Hex, 'reserved-address-value'>; | ||
declare const toAddress: (value: string | number | bigint | ArrayBuffer, config?: HexConfig) => Lowercase<string>; | ||
declare const isAddress: (value: unknown, config?: HexConfig) => value is Address; | ||
declare function asAddress(value: unknown): Address | undefined; | ||
declare function asAddress(value: unknown, assert: AssertConfig): Address; | ||
type HashBitLength = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096; | ||
declare const HashBitLength: HashBitLength[]; | ||
declare const isHashBitLength: (value: unknown) => value is HashBitLength; | ||
type Hash = Exclude<Hex, 'reserved-hash-value'>; | ||
declare const isHash: (value: unknown, bitLength?: HashBitLength) => value is Hash; | ||
declare function asHash(value: unknown): Hash | undefined; | ||
declare function asHash(value: unknown, assert: AssertConfig): Hash; | ||
export { type Address, type Hash, HashBitLength, type Hex, type HexConfig, asAddress, asHash, asHex, bitsToNibbles, hexFrom, hexFromArrayBuffer, hexFromBigInt, hexFromHexString, hexFromNumber, hexRegex, hexRegexWithPrefix, isAddress, isHash, isHashBitLength, isHex, isHexZero, nibblesToBits, toAddress, toHex, toHexLegacy }; | ||
export * from './address.ts'; | ||
export * from './hash.ts'; | ||
export * from './hex/index.ts'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@xylabs/hex", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries", | ||
@@ -42,4 +42,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@xylabs/ts-scripts-yarn3": "^4.0.0", | ||
"@xylabs/tsconfig": "^4.0.0", | ||
"@xylabs/ts-scripts-yarn3": "^4.0.7", | ||
"@xylabs/tsconfig": "^4.0.7", | ||
"typescript": "^5.5.4" | ||
@@ -46,0 +46,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49138
63
500