@xylabs/hex 2.13.20 → 2.13.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/browser/address.d.cts +0 -1
  2. package/dist/browser/address.d.cts.map +1 -1
  3. package/dist/browser/address.d.mts +0 -1
  4. package/dist/browser/address.d.mts.map +1 -1
  5. package/dist/browser/address.d.ts +0 -1
  6. package/dist/browser/address.d.ts.map +1 -1
  7. package/dist/browser/assert.d.cts.map +1 -1
  8. package/dist/browser/assert.d.mts.map +1 -1
  9. package/dist/browser/assert.d.ts.map +1 -1
  10. package/dist/browser/hex/{from.d.cts → from/from.d.cts} +1 -2
  11. package/dist/browser/hex/from/from.d.cts.map +1 -0
  12. package/dist/{node/hex → browser/hex/from}/from.d.mts +1 -2
  13. package/dist/browser/hex/from/from.d.mts.map +1 -0
  14. package/dist/{node/hex → browser/hex/from}/from.d.ts +1 -2
  15. package/dist/browser/hex/from/from.d.ts.map +1 -0
  16. package/dist/browser/hex/from/fromHexString.d.cts +3 -0
  17. package/dist/browser/hex/from/fromHexString.d.cts.map +1 -0
  18. package/dist/browser/hex/from/fromHexString.d.mts +3 -0
  19. package/dist/browser/hex/from/fromHexString.d.mts.map +1 -0
  20. package/dist/browser/hex/from/fromHexString.d.ts +3 -0
  21. package/dist/browser/hex/from/fromHexString.d.ts.map +1 -0
  22. package/dist/browser/hex/from/index.d.cts +3 -0
  23. package/dist/browser/hex/from/index.d.cts.map +1 -0
  24. package/dist/browser/hex/from/index.d.mts +3 -0
  25. package/dist/browser/hex/from/index.d.mts.map +1 -0
  26. package/dist/browser/hex/from/index.d.ts +3 -0
  27. package/dist/browser/hex/from/index.d.ts.map +1 -0
  28. package/dist/browser/hex/index.d.cts +1 -0
  29. package/dist/browser/hex/index.d.cts.map +1 -1
  30. package/dist/browser/hex/index.d.mts +1 -0
  31. package/dist/browser/hex/index.d.mts.map +1 -1
  32. package/dist/browser/hex/index.d.ts +1 -0
  33. package/dist/browser/hex/index.d.ts.map +1 -1
  34. package/dist/browser/hex/is.d.cts +2 -2
  35. package/dist/browser/hex/is.d.cts.map +1 -1
  36. package/dist/browser/hex/is.d.mts +2 -2
  37. package/dist/browser/hex/is.d.mts.map +1 -1
  38. package/dist/browser/hex/is.d.ts +2 -2
  39. package/dist/browser/hex/is.d.ts.map +1 -1
  40. package/dist/browser/hex/isHexZero.d.cts +2 -0
  41. package/dist/browser/hex/isHexZero.d.cts.map +1 -0
  42. package/dist/browser/hex/isHexZero.d.mts +2 -0
  43. package/dist/browser/hex/isHexZero.d.mts.map +1 -0
  44. package/dist/browser/hex/isHexZero.d.ts +2 -0
  45. package/dist/browser/hex/isHexZero.d.ts.map +1 -0
  46. package/dist/browser/hex/regex.d.cts.map +1 -1
  47. package/dist/browser/hex/regex.d.mts.map +1 -1
  48. package/dist/browser/hex/regex.d.ts.map +1 -1
  49. package/dist/browser/index.cjs +54 -47
  50. package/dist/browser/index.cjs.map +1 -1
  51. package/dist/browser/index.js +54 -47
  52. package/dist/browser/index.js.map +1 -1
  53. package/dist/node/address.d.cts +0 -1
  54. package/dist/node/address.d.cts.map +1 -1
  55. package/dist/node/address.d.mts +0 -1
  56. package/dist/node/address.d.mts.map +1 -1
  57. package/dist/node/address.d.ts +0 -1
  58. package/dist/node/address.d.ts.map +1 -1
  59. package/dist/node/assert.d.cts.map +1 -1
  60. package/dist/node/assert.d.mts.map +1 -1
  61. package/dist/node/assert.d.ts.map +1 -1
  62. package/dist/node/hex/{from.d.cts → from/from.d.cts} +1 -2
  63. package/dist/node/hex/from/from.d.cts.map +1 -0
  64. package/dist/{browser/hex → node/hex/from}/from.d.mts +1 -2
  65. package/dist/node/hex/from/from.d.mts.map +1 -0
  66. package/dist/{browser/hex → node/hex/from}/from.d.ts +1 -2
  67. package/dist/node/hex/from/from.d.ts.map +1 -0
  68. package/dist/node/hex/from/fromHexString.d.cts +3 -0
  69. package/dist/node/hex/from/fromHexString.d.cts.map +1 -0
  70. package/dist/node/hex/from/fromHexString.d.mts +3 -0
  71. package/dist/node/hex/from/fromHexString.d.mts.map +1 -0
  72. package/dist/node/hex/from/fromHexString.d.ts +3 -0
  73. package/dist/node/hex/from/fromHexString.d.ts.map +1 -0
  74. package/dist/node/hex/from/index.d.cts +3 -0
  75. package/dist/node/hex/from/index.d.cts.map +1 -0
  76. package/dist/node/hex/from/index.d.mts +3 -0
  77. package/dist/node/hex/from/index.d.mts.map +1 -0
  78. package/dist/node/hex/from/index.d.ts +3 -0
  79. package/dist/node/hex/from/index.d.ts.map +1 -0
  80. package/dist/node/hex/index.d.cts +1 -0
  81. package/dist/node/hex/index.d.cts.map +1 -1
  82. package/dist/node/hex/index.d.mts +1 -0
  83. package/dist/node/hex/index.d.mts.map +1 -1
  84. package/dist/node/hex/index.d.ts +1 -0
  85. package/dist/node/hex/index.d.ts.map +1 -1
  86. package/dist/node/hex/is.d.cts +2 -2
  87. package/dist/node/hex/is.d.cts.map +1 -1
  88. package/dist/node/hex/is.d.mts +2 -2
  89. package/dist/node/hex/is.d.mts.map +1 -1
  90. package/dist/node/hex/is.d.ts +2 -2
  91. package/dist/node/hex/is.d.ts.map +1 -1
  92. package/dist/node/hex/isHexZero.d.cts +2 -0
  93. package/dist/node/hex/isHexZero.d.cts.map +1 -0
  94. package/dist/node/hex/isHexZero.d.mts +2 -0
  95. package/dist/node/hex/isHexZero.d.mts.map +1 -0
  96. package/dist/node/hex/isHexZero.d.ts +2 -0
  97. package/dist/node/hex/isHexZero.d.ts.map +1 -0
  98. package/dist/node/hex/regex.d.cts.map +1 -1
  99. package/dist/node/hex/regex.d.mts.map +1 -1
  100. package/dist/node/hex/regex.d.ts.map +1 -1
  101. package/dist/node/index.cjs +54 -48
  102. package/dist/node/index.cjs.map +1 -1
  103. package/dist/node/index.js +54 -47
  104. package/dist/node/index.js.map +1 -1
  105. package/package.json +9 -6
  106. package/src/address.ts +6 -17
  107. package/src/assert.ts +2 -1
  108. package/src/hash.ts +5 -3
  109. package/src/hex/as.ts +4 -2
  110. package/src/hex/{from.ts → from/from.ts} +15 -22
  111. package/src/hex/from/fromHexString.ts +15 -0
  112. package/src/hex/from/index.ts +2 -0
  113. package/src/hex/index.ts +1 -0
  114. package/src/hex/is.ts +7 -10
  115. package/src/hex/isHexZero.ts +5 -0
  116. package/src/hex/nibble.ts +1 -1
  117. package/src/hex/regex.ts +2 -2
  118. package/dist/browser/hex/from.d.cts.map +0 -1
  119. package/dist/browser/hex/from.d.mts.map +0 -1
  120. package/dist/browser/hex/from.d.ts.map +0 -1
  121. package/dist/node/hex/from.d.cts.map +0 -1
  122. package/dist/node/hex/from.d.mts.map +0 -1
  123. package/dist/node/hex/from.d.ts.map +0 -1
@@ -3,20 +3,20 @@ var assertError = (value, assert, defaultMessage) => {
3
3
  if (assert) {
4
4
  const assertString = typeof assert === "string" ? assert : typeof assert === "boolean" ? defaultMessage : assert(value, defaultMessage);
5
5
  if (assertString) {
6
- throw Error(assertString === true ? defaultMessage : assertString);
6
+ throw new Error(assertString === true ? defaultMessage : assertString);
7
7
  }
8
8
  }
9
9
  return void 0;
10
10
  };
11
11
 
12
- // src/hex/from.ts
12
+ // src/hex/from/from.ts
13
13
  import { isArrayBuffer } from "@xylabs/arraybuffer";
14
14
 
15
15
  // src/hex/nibble.ts
16
16
  var bitsToNibbles = (value) => {
17
17
  const nibbles = value >> 2;
18
18
  if (value !== nibbles << 2)
19
- throw Error("Bits for nibbles must multiple of 4");
19
+ throw new Error("Bits for nibbles must multiple of 4");
20
20
  return nibbles;
21
21
  };
22
22
  var nibblesToBits = (value) => {
@@ -24,22 +24,33 @@ var nibblesToBits = (value) => {
24
24
  };
25
25
 
26
26
  // src/hex/regex.ts
27
- var hexRegex = /^[0-9a-f]+$/i;
28
- var hexRegexWithPrefix = /0x[0-9a-f]+$/i;
27
+ var hexRegex = /^[\da-f]+$/i;
28
+ var hexRegexWithPrefix = /0x[\da-f]+$/i;
29
29
 
30
30
  // src/hex/is.ts
31
- var isHexZero = (value) => {
32
- return BigInt(hexFromHexString(value, { prefix: true })) === 0n;
33
- };
34
- var isHex = (value, bitLength) => {
31
+ var isHex = (value, config) => {
35
32
  if (typeof value !== "string")
36
33
  return false;
37
- if (bitLength !== void 0 && value.length !== bitsToNibbles(bitLength))
34
+ const valueCharLength = config?.prefix ? value.length - 2 : value.length;
35
+ if (config?.bitLength !== void 0 && valueCharLength !== bitsToNibbles(config?.bitLength))
38
36
  return false;
39
- return hexRegex.test(value);
37
+ return config?.prefix ? hexRegexWithPrefix.test(value) : hexRegex.test(value);
38
+ };
39
+
40
+ // src/hex/from/fromHexString.ts
41
+ var hexFromHexString = (value, config = {}) => {
42
+ const { prefix = false, byteSize = 8 } = config;
43
+ const nibbleBoundary = bitsToNibbles(byteSize);
44
+ const unPadded = (value.startsWith("0x") ? value.slice(2) : value).toLowerCase();
45
+ if (isHex(unPadded)) {
46
+ const padded = unPadded.padStart(unPadded.length + unPadded.length % nibbleBoundary, "0");
47
+ return prefix ? `0x${padded}` : padded;
48
+ } else {
49
+ throw new Error("Received string is not a value hex");
50
+ }
40
51
  };
41
52
 
42
- // src/hex/from.ts
53
+ // src/hex/from/from.ts
43
54
  var hexFromArrayBuffer = (buffer, config) => {
44
55
  const unPadded = [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, "0")).join("");
45
56
  return hexFromHexString(unPadded, config);
@@ -53,33 +64,27 @@ var hexFromBigInt = (value, config = {}) => {
53
64
  var hexFromNumber = (value, config) => {
54
65
  return hexFromBigInt(BigInt(value), config);
55
66
  };
56
- var hexFromHexString = (value, config = {}) => {
57
- const { prefix = false, byteSize = 8 } = config;
58
- const nibbleBoundary = bitsToNibbles(byteSize);
59
- const unPadded = (value.startsWith("0x") ? value.substring(2) : value).toLowerCase();
60
- if (isHex(unPadded)) {
61
- const padded = unPadded.padStart(unPadded.length + unPadded.length % nibbleBoundary, "0");
62
- return prefix ? `0x${padded}` : padded;
63
- } else {
64
- throw Error("Received string is not a value hex");
65
- }
66
- };
67
67
  var hexFrom = (value, config) => {
68
68
  switch (typeof value) {
69
- case "string":
69
+ case "string": {
70
70
  return hexFromHexString(value, config);
71
- case "bigint":
71
+ }
72
+ case "bigint": {
72
73
  return hexFromBigInt(value, config);
73
- case "number":
74
+ }
75
+ case "number": {
74
76
  return hexFromNumber(value, config);
75
- case "object":
77
+ }
78
+ case "object": {
76
79
  if (isArrayBuffer(value)) {
77
80
  return hexFromArrayBuffer(value, config);
78
81
  } else {
79
- throw Error("Invalid type: object !== ArrayBuffer");
82
+ throw new Error("Invalid type: object !== ArrayBuffer");
80
83
  }
81
- default:
82
- throw Error(`Invalid type: ${typeof value}`);
84
+ }
85
+ default: {
86
+ throw new Error(`Invalid type: ${typeof value}`);
87
+ }
83
88
  }
84
89
  };
85
90
 
@@ -87,15 +92,22 @@ var hexFrom = (value, config) => {
87
92
  function asHex(value, assert) {
88
93
  let stringValue = void 0;
89
94
  switch (typeof value) {
90
- case "string":
95
+ case "string": {
91
96
  stringValue = hexFromHexString(value);
92
97
  break;
93
- default:
98
+ }
99
+ default: {
94
100
  return assertError(value, assert, `Unsupported type [${typeof value}]`);
101
+ }
95
102
  }
96
103
  return isHex(stringValue) ? stringValue : assertError(value, assert, `Value is not Hex [${value}]`);
97
104
  }
98
105
 
106
+ // src/hex/isHexZero.ts
107
+ var isHexZero = (value) => {
108
+ return value ? BigInt(hexFromHexString(value, { prefix: true })) === 0n : void 0;
109
+ };
110
+
99
111
  // src/hex/legacy.ts
100
112
  var toHexLegacy = (buffer) => {
101
113
  return [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, "0")).join("");
@@ -105,29 +117,23 @@ var toHex = (buffer) => {
105
117
  };
106
118
 
107
119
  // src/address.ts
108
- var addressRegex = /0x[0-9a-f]+/i;
109
120
  var toAddress = (value, config = {}) => {
110
121
  const { bitLength = 160, prefix = true } = config;
111
122
  return hexFrom(value, { bitLength, prefix, ...config });
112
123
  };
113
124
  var isAddress = (value, bitLength = 160) => {
114
- if (typeof value !== "string")
115
- return false;
116
- if (!addressRegex.test(value))
117
- return false;
118
- const valueHex = value.substring(2);
119
- if (bitLength !== void 0 && valueHex.length !== bitsToNibbles(bitLength))
120
- return false;
121
- return isHex(valueHex, bitLength);
125
+ return isHex(value, { bitLength, prefix: true });
122
126
  };
123
127
  function asAddress(value, assert) {
124
128
  let stringValue = void 0;
125
129
  switch (typeof value) {
126
- case "string":
130
+ case "string": {
127
131
  stringValue = hexFromHexString(value, { prefix: true });
128
132
  break;
129
- default:
133
+ }
134
+ default: {
130
135
  return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : void 0;
136
+ }
131
137
  }
132
138
  return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`);
133
139
  }
@@ -138,22 +144,23 @@ var isHashBitLength = (value) => {
138
144
  return typeof value === "number" && HashBitLength.includes(value);
139
145
  };
140
146
  var isHash = (value, bitLength = 256) => {
141
- return isHex(value, bitLength);
147
+ return isHex(value, { bitLength });
142
148
  };
143
149
  function asHash(value, assert) {
144
150
  let stringValue = void 0;
145
151
  switch (typeof value) {
146
- case "string":
152
+ case "string": {
147
153
  stringValue = hexFromHexString(value);
148
154
  break;
149
- default:
155
+ }
156
+ default: {
150
157
  return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : void 0;
158
+ }
151
159
  }
152
160
  return isHash(stringValue) ? stringValue : assertError(value, assert, `Value is not a Hash [${value}]`);
153
161
  }
154
162
  export {
155
163
  HashBitLength,
156
- addressRegex,
157
164
  asAddress,
158
165
  asHash,
159
166
  asHex,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/assert.ts","../../src/hex/from.ts","../../src/hex/nibble.ts","../../src/hex/regex.ts","../../src/hex/is.ts","../../src/hex/as.ts","../../src/hex/legacy.ts","../../src/address.ts","../../src/hash.ts"],"sourcesContent":["export type AssertCallback = (value: unknown, message: string) => string | boolean\n\nexport type AssertConfig = string | AssertCallback | boolean\n\nexport const assertError = (value: unknown, assert: AssertConfig | undefined, defaultMessage: string) => {\n if (assert) {\n const assertString = typeof assert === 'string' ? assert : typeof assert === 'boolean' ? defaultMessage : assert(value, defaultMessage)\n if (assertString) {\n throw Error(assertString === true ? defaultMessage : assertString)\n }\n }\n return undefined\n}\n","import { isArrayBuffer } from '@xylabs/arraybuffer'\n\nimport { isHex } from './is'\nimport { HexConfig } from './model'\nimport { bitsToNibbles } from './nibble'\n\nexport const hexFromArrayBuffer = (buffer: ArrayBuffer, config?: HexConfig): string => {\n const unPadded = [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, '0')).join('')\n return hexFromHexString(unPadded, config)\n}\n\nexport const hexFromBigInt = (value: bigint, config: HexConfig = {}): string => {\n const { bitLength } = config\n const unPadded = value.toString(16)\n const padded = bitLength === undefined ? unPadded : unPadded.padStart(bitsToNibbles(bitLength), '0')\n return hexFromHexString(padded, config)\n}\n\nexport const hexFromNumber = (value: number, config?: HexConfig): string => {\n return hexFromBigInt(BigInt(value), config)\n}\n\nexport const hexFromHexString = (value: string, config: HexConfig = {}): string => {\n const { prefix = false, byteSize = 8 } = config\n const nibbleBoundary = bitsToNibbles(byteSize)\n const unPadded = (value.startsWith('0x') ? value.substring(2) : value).toLowerCase()\n if (isHex(unPadded)) {\n const padded = unPadded.padStart(unPadded.length + (unPadded.length % nibbleBoundary), '0')\n return prefix ? `0x${padded}` : padded\n } else {\n throw Error('Received string is not a value hex')\n }\n}\n\nexport const hexFrom = (value: unknown, config?: HexConfig): string => {\n switch (typeof value) {\n case 'string':\n return hexFromHexString(value, config)\n case 'bigint':\n return hexFromBigInt(value, config)\n case 'number':\n return hexFromNumber(value, config)\n case 'object':\n if (isArrayBuffer(value)) {\n return hexFromArrayBuffer(value, config)\n } else {\n throw Error('Invalid type: object !== ArrayBuffer')\n }\n default:\n throw Error(`Invalid type: ${typeof value}`)\n }\n}\n","//determine the number of nibbles for a given number of bits\nexport const bitsToNibbles = (value: number): number => {\n const nibbles = value >> 2\n if (value !== nibbles << 2) throw Error('Bits for nibbles must multiple of 4')\n return nibbles\n}\n\n//determine the number of nibbles for a given number of bits\nexport const nibblesToBits = (value: number): number => {\n return value << 2\n}\n","export const hexRegex = /^[0-9a-f]+$/i\nexport const hexRegexWithPrefix = /0x[0-9a-f]+$/i\n","import { hexFromHexString } from './from'\nimport { Hex } from './model'\nimport { bitsToNibbles } from './nibble'\nimport { hexRegex } from './regex'\n\nexport const isHexZero = (value: string) => {\n return BigInt(hexFromHexString(value, { prefix: true })) === 0n\n}\n\nexport const isHex = (value: unknown, bitLength?: number): value is Hex => {\n //Is it a string?\n if (typeof value !== 'string') return false\n\n //If a bitLength specified, does it conform?\n if (bitLength !== undefined && value.length !== bitsToNibbles(bitLength)) return false\n\n //Does it only has hex values?\n return hexRegex.test(value)\n}\n","import { AssertConfig, assertError } from '../assert'\nimport { hexFromHexString } from './from'\nimport { isHex } from './is'\nimport { Hex } from './model'\n\nexport function asHex(value: unknown): Hex | undefined\nexport function asHex(value: unknown, assert: AssertConfig): Hex\nexport function asHex(value: unknown, assert?: AssertConfig): Hex | undefined {\n let stringValue: string | undefined = undefined\n\n switch (typeof value) {\n case 'string':\n stringValue = hexFromHexString(value)\n break\n default:\n return assertError(value, assert, `Unsupported type [${typeof value}]`)\n }\n\n return isHex(stringValue) ? stringValue : assertError(value, assert, `Value is not Hex [${value}]`)\n}\n","export const toHexLegacy = (buffer: ArrayBuffer) => {\n return [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, '0')).join('')\n}\n\n/** @deprecated use toHexLegacy instead */\nexport const toHex = (buffer: ArrayBuffer) => {\n return toHexLegacy(buffer)\n}\n","import { AssertConfig, assertError } from './assert'\nimport { bitsToNibbles, HexConfig, hexFrom, hexFromHexString, isHex } from './hex'\n\nexport const addressRegex = /0x[0-9a-f]+/i\n\nexport type Address = string\n\nexport const toAddress = (value: unknown, config: HexConfig = {}) => {\n const { bitLength = 160, prefix = true } = config\n return hexFrom(value, { bitLength, prefix, ...config })\n}\n\nexport const isAddress = (value: unknown, bitLength = 160): value is Address => {\n //Is it a string?\n if (typeof value !== 'string') return false\n\n //Does it only has hex values and leading 0x?\n if (!addressRegex.test(value)) return false\n\n const valueHex = value.substring(2)\n\n //If a bitLength specified, does it conform?\n if (bitLength !== undefined && valueHex.length !== bitsToNibbles(bitLength)) return false\n\n return isHex(valueHex, bitLength)\n}\n\nexport function asAddress(value: unknown): Address | undefined\nexport function asAddress(value: unknown, assert: AssertConfig): Address\nexport function asAddress(value: unknown, assert?: AssertConfig): Address | undefined {\n let stringValue: string | undefined = undefined\n\n switch (typeof value) {\n case 'string':\n stringValue = hexFromHexString(value, { prefix: true })\n break\n default:\n return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : undefined\n }\n return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`)\n}\n","import { AssertConfig, assertError } from './assert'\nimport { Hex, hexFromHexString, isHex } from './hex'\n\nexport type HashBitLength = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096\nexport const HashBitLength: HashBitLength[] = [32, 64, 128, 256, 512, 1024, 2048, 4096]\n\nexport const isHashBitLength = (value: unknown): value is HashBitLength => {\n return typeof value === 'number' && HashBitLength.includes(value as HashBitLength)\n}\n\nexport type Hash = Hex\nexport const isHash = (value: unknown, bitLength: HashBitLength = 256): value is Hash => {\n return isHex(value, bitLength)\n}\n\nexport function asHash(value: unknown): Hash | undefined\nexport function asHash(value: unknown, assert: AssertConfig): Hash\nexport function asHash(value: unknown, assert?: AssertConfig): Hash | undefined {\n let stringValue: string | undefined = undefined\n\n switch (typeof value) {\n case 'string':\n stringValue = hexFromHexString(value)\n break\n default:\n return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : undefined\n }\n return isHash(stringValue) ? stringValue : assertError(value, assert, `Value is not a Hash [${value}]`)\n}\n"],"mappings":";AAIO,IAAM,cAAc,CAAC,OAAgB,QAAkC,mBAA2B;AACvG,MAAI,QAAQ;AACV,UAAM,eAAe,OAAO,WA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AI,cAAkC;AAEtC,UAAQ,OAAO,OAAO;AAAA,IACpB,KAAK;AACH,oBAAc,iBAAiB,KAAK;AACpC;AAAA,IACF;AACE,aAAO,SAAS,YAAY,OAAO,QAAQ,qBAAqB,OAAO,KAAK,GAAG,IAAI;AAAA,EACvF;AACA,SAAO,OAAO,WAAW,IAAI,cAAc,YAAY,OAAO,QAAQ,wBAAwB,KAAK,GAAG;AACxG;","names":[]}
1
+ {"version":3,"sources":["../../src/assert.ts","../../src/hex/from/from.ts","../../src/hex/nibble.ts","../../src/hex/regex.ts","../../src/hex/is.ts","../../src/hex/from/fromHexString.ts","../../src/hex/as.ts","../../src/hex/isHexZero.ts","../../src/hex/legacy.ts","../../src/address.ts","../../src/hash.ts"],"sourcesContent":["export type AssertCallback = (value: unknown, message: string) => string | boolean\n\nexport type AssertConfig = string | AssertCallback | boolean\n\nexport const assertError = (value: unknown, assert: AssertConfig | undefined, defaultMessage: string) => {\n if (assert) {\n const assertString = typeof assert === 'string' ? assert : typeof assert === 'boolean' ? defaultMessage : assert(value, defaultMessage)\n if (assertString) {\n throw new Error(assertString === true ? defaultMessage : assertString)\n }\n }\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined\n}\n","import { isArrayBuffer } from '@xylabs/arraybuffer'\n\nimport { HexConfig } from '../model'\nimport { bitsToNibbles } from '../nibble'\nimport { hexFromHexString } from './fromHexString'\n\nexport const hexFromArrayBuffer = (buffer: ArrayBuffer, config?: HexConfig): string => {\n const unPadded = [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, '0')).join('')\n return hexFromHexString(unPadded, config)\n}\n\nexport const hexFromBigInt = (value: bigint, config: HexConfig = {}): string => {\n const { bitLength } = config\n const unPadded = value.toString(16)\n const padded = bitLength === undefined ? unPadded : unPadded.padStart(bitsToNibbles(bitLength), '0')\n return hexFromHexString(padded, config)\n}\n\nexport const hexFromNumber = (value: number, config?: HexConfig): string => {\n return hexFromBigInt(BigInt(value), config)\n}\n\nexport const hexFrom = (value: unknown, config?: HexConfig): string => {\n switch (typeof value) {\n case 'string': {\n return hexFromHexString(value, config)\n }\n case 'bigint': {\n return hexFromBigInt(value, config)\n }\n case 'number': {\n return hexFromNumber(value, config)\n }\n case 'object': {\n if (isArrayBuffer(value)) {\n return hexFromArrayBuffer(value, config)\n } else {\n throw new Error('Invalid type: object !== ArrayBuffer')\n }\n }\n default: {\n throw new Error(`Invalid type: ${typeof value}`)\n }\n }\n}\n","//determine the number of nibbles for a given number of bits\nexport const bitsToNibbles = (value: number): number => {\n const nibbles = value >> 2\n if (value !== nibbles << 2) throw new Error('Bits for nibbles must multiple of 4')\n return nibbles\n}\n\n//determine the number of nibbles for a given number of bits\nexport const nibblesToBits = (value: number): number => {\n return value << 2\n}\n","export const hexRegex = /^[\\da-f]+$/i\nexport const hexRegexWithPrefix = /0x[\\da-f]+$/i\n","import { Hex, HexConfig } from './model'\nimport { bitsToNibbles } from './nibble'\nimport { hexRegex, hexRegexWithPrefix } from './regex'\n\nexport const isHex = (value: unknown, config?: HexConfig): value is Hex => {\n //Is it a string?\n if (typeof value !== 'string') return false\n\n const valueCharLength = config?.prefix ? value.length - 2 : value.length\n\n //If a bitLength specified, does it conform?\n if (config?.bitLength !== undefined && valueCharLength !== bitsToNibbles(config?.bitLength)) return false\n\n //Does it only has hex values?\n return config?.prefix ? hexRegexWithPrefix.test(value) : hexRegex.test(value)\n}\n","import { isHex } from '../is'\nimport { HexConfig } from '../model'\nimport { bitsToNibbles } from '../nibble'\n\nexport const hexFromHexString = (value: string, config: HexConfig = {}): string => {\n const { prefix = false, byteSize = 8 } = config\n const nibbleBoundary = bitsToNibbles(byteSize)\n const unPadded = (value.startsWith('0x') ? value.slice(2) : value).toLowerCase()\n if (isHex(unPadded)) {\n const padded = unPadded.padStart(unPadded.length + (unPadded.length % nibbleBoundary), '0')\n return prefix ? `0x${padded}` : padded\n } else {\n throw new Error('Received string is not a value hex')\n }\n}\n","import { AssertConfig, assertError } from '../assert'\nimport { hexFromHexString } from './from'\nimport { isHex } from './is'\nimport { Hex } from './model'\n\nexport function asHex(value: unknown): Hex | undefined\nexport function asHex(value: unknown, assert: AssertConfig): Hex\nexport function asHex(value: unknown, assert?: AssertConfig): Hex | undefined {\n let stringValue: string | undefined = undefined\n\n switch (typeof value) {\n case 'string': {\n stringValue = hexFromHexString(value)\n break\n }\n default: {\n return assertError(value, assert, `Unsupported type [${typeof value}]`)\n }\n }\n\n return isHex(stringValue) ? stringValue : assertError(value, assert, `Value is not Hex [${value}]`)\n}\n","import { hexFromHexString } from './from'\n\nexport const isHexZero = (value?: string) => {\n return value ? BigInt(hexFromHexString(value, { prefix: true })) === 0n : undefined\n}\n","export const toHexLegacy = (buffer: ArrayBuffer) => {\n return [...new Uint8Array(buffer)].map((x) => x.toString(16).padStart(2, '0')).join('')\n}\n\n/** @deprecated use toHexLegacy instead */\nexport const toHex = (buffer: ArrayBuffer) => {\n return toHexLegacy(buffer)\n}\n","import { AssertConfig, assertError } from './assert'\nimport { HexConfig, hexFrom, hexFromHexString, isHex } from './hex'\n\nexport type Address = string\n\nexport const toAddress = (value: unknown, config: HexConfig = {}) => {\n const { bitLength = 160, prefix = true } = config\n return hexFrom(value, { bitLength, prefix, ...config })\n}\n\nexport const isAddress = (value: unknown, bitLength = 160): value is Address => {\n return isHex(value, { bitLength, prefix: true })\n}\n\nexport function asAddress(value: unknown): Address | undefined\nexport function asAddress(value: unknown, assert: AssertConfig): Address\nexport function asAddress(value: unknown, assert?: AssertConfig): Address | undefined {\n let stringValue: string | undefined = undefined\n\n switch (typeof value) {\n case 'string': {\n stringValue = hexFromHexString(value, { prefix: true })\n break\n }\n default: {\n return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : undefined\n }\n }\n return isAddress(stringValue) ? stringValue : assertError(value, assert, `Value is not an Address [${value}]`)\n}\n","import { AssertConfig, assertError } from './assert'\nimport { Hex, hexFromHexString, isHex } from './hex'\n\nexport type HashBitLength = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096\nexport const HashBitLength: HashBitLength[] = [32, 64, 128, 256, 512, 1024, 2048, 4096]\n\nexport const isHashBitLength = (value: unknown): value is HashBitLength => {\n return typeof value === 'number' && HashBitLength.includes(value as HashBitLength)\n}\n\nexport type Hash = Hex\nexport const isHash = (value: unknown, bitLength: HashBitLength = 256): value is Hash => {\n return isHex(value, { bitLength })\n}\n\nexport function asHash(value: unknown): Hash | undefined\nexport function asHash(value: unknown, assert: AssertConfig): Hash\nexport function asHash(value: unknown, assert?: AssertConfig): Hash | undefined {\n let stringValue: string | undefined = undefined\n\n switch (typeof value) {\n case 'string': {\n stringValue = hexFromHexString(value)\n break\n }\n default: {\n return assert ? assertError(value, assert, `Unsupported type [${typeof value}]`) : undefined\n }\n }\n return isHash(stringValue) ? stringValue : assertError(value, assert, `Value is not a Hash [${value}]`)\n}\n"],"mappings":";AAIO,IAAM,cAAc,CAAC,OAAgB,QAAkC,mBAA2B;AACvG,MAAI,QAAQ;AACV,UAAM,eAAe,OAAO,WAAW,WAAW,SAAS,OAAO,WAAW,YAAY,iBAAiB,OAAO,OAAO,cAAc;AACtI,QAAI,cAAc;AAChB,YAAM,IAAI,MAAM,iBAAiB,OAAO,iBAAiB,YAAY;AAAA,IACvE;AAAA,EACF;AAEA,SAAO;AACT;;;ACbA,SAAS,qBAAqB;;;ACCvB,IAAM,gBAAgB,CAAC,UAA0B;AACtD,QAAM,UAAU,SAAS;AACzB,MAAI,UAAU,WAAW;AAAG,UAAM,IAAI,MAAM,qCAAqC;AACjF,SAAO;AACT;AAGO,IAAM,gBAAgB,CAAC,UAA0B;AACtD,SAAO,SAAS;AAClB;;;ACVO,IAAM,WAAW;AACjB,IAAM,qBAAqB;;;ACG3B,IAAM,QAAQ,CAAC,OAAgB,WAAqC;AAEzE,MAAI,OAAO,UAAU;AAAU,WAAO;AAEtC,QAAM,kBAAkB,QAAQ,SAAS,MAAM,SAAS,IAAI,MAAM;AAGlE,MAAI,QAAQ,cAAc,UAAa,oBAAoB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AAM,YAAY,CAAC,OAAgB,YAAY,QAA0B;AAC9E,SAAO,MAAM,OAAO,EAAE,WAAW,QAAQ,KAAK,CAAC;AACjD;AAIO,SAAS,UAAU,OAAgB,QAA4C;AACpF,MAAI,cAAkC;AAEtC,UAAQ,OAAO,OAAO;AAAA,IACpB,KAAK,UAAU;AACb,oBAAc,iBAAiB,OAAO,EAAE,QAAQ,KAAK,CAAC;AACtD;AAAA,IACF;AAAA,IACA,SAAS;AACP,aAAO,SAAS,YAAY,OAAO,QAAQ,qBAAqB,OAAO,KAAK,GAAG,IAAI;AAAA,IACrF;AAAA,EACF;AACA,SAAO,UAAU,WAAW,IAAI,cAAc,YAAY,OAAO,QAAQ,4BAA4B,KAAK,GAAG;AAC/G;;;ACzBO,IAAM,gBAAiC,CAAC,IAAI,IAAI,KAAK,KAAK,KAAK,MAAM,MAAM,IAAI;AAE/E,IAAM,kBAAkB,CAAC,UAA2C;AACzE,SAAO,OAAO,UAAU,YAAY,cAAc,SAAS,KAAsB;AACnF;AAGO,IAAM,SAAS,CAAC,OAAgB,YAA2B,QAAuB;AACvF,SAAO,MAAM,OAAO,EAAE,UAAU,CAAC;AACnC;AAIO,SAAS,OAAO,OAAgB,QAAyC;AAC9E,MAAI,cAAkC;AAEtC,UAAQ,OAAO,OAAO;AAAA,IACpB,KAAK,UAAU;AACb,oBAAc,iBAAiB,KAAK;AACpC;AAAA,IACF;AAAA,IACA,SAAS;AACP,aAAO,SAAS,YAAY,OAAO,QAAQ,qBAAqB,OAAO,KAAK,GAAG,IAAI;AAAA,IACrF;AAAA,EACF;AACA,SAAO,OAAO,WAAW,IAAI,cAAc,YAAY,OAAO,QAAQ,wBAAwB,KAAK,GAAG;AACxG;","names":[]}
@@ -1,6 +1,5 @@
1
1
  import { AssertConfig } from './assert';
2
2
  import { HexConfig } from './hex';
3
- export declare const addressRegex: RegExp;
4
3
  export type Address = string;
5
4
  export declare const toAddress: (value: unknown, config?: HexConfig) => string;
6
5
  export declare const isAddress: (value: unknown, bitLength?: number) => value is string;
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,UAAU,CAAA;AACpD,OAAO,EAAiB,SAAS,EAAoC,MAAM,OAAO,CAAA;AAElF,eAAO,MAAM,YAAY,QAAiB,CAAA;AAE1C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,eAAO,MAAM,SAAS,UAAW,OAAO,WAAU,SAAS,WAG1D,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,OAAO,wCAavC,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAC9D,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAA"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAA;AAEnE,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,eAAO,MAAM,SAAS,UAAW,OAAO,WAAU,SAAS,WAG1D,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,OAAO,wCAEvC,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAC9D,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import { AssertConfig } from './assert';
2
2
  import { HexConfig } from './hex';
3
- export declare const addressRegex: RegExp;
4
3
  export type Address = string;
5
4
  export declare const toAddress: (value: unknown, config?: HexConfig) => string;
6
5
  export declare const isAddress: (value: unknown, bitLength?: number) => value is string;
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,UAAU,CAAA;AACpD,OAAO,EAAiB,SAAS,EAAoC,MAAM,OAAO,CAAA;AAElF,eAAO,MAAM,YAAY,QAAiB,CAAA;AAE1C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,eAAO,MAAM,SAAS,UAAW,OAAO,WAAU,SAAS,WAG1D,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,OAAO,wCAavC,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAC9D,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAA"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAA;AAEnE,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,eAAO,MAAM,SAAS,UAAW,OAAO,WAAU,SAAS,WAG1D,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,OAAO,wCAEvC,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAC9D,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import { AssertConfig } from './assert';
2
2
  import { HexConfig } from './hex';
3
- export declare const addressRegex: RegExp;
4
3
  export type Address = string;
5
4
  export declare const toAddress: (value: unknown, config?: HexConfig) => string;
6
5
  export declare const isAddress: (value: unknown, bitLength?: number) => value is string;
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,UAAU,CAAA;AACpD,OAAO,EAAiB,SAAS,EAAoC,MAAM,OAAO,CAAA;AAElF,eAAO,MAAM,YAAY,QAAiB,CAAA;AAE1C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,eAAO,MAAM,SAAS,UAAW,OAAO,WAAU,SAAS,WAG1D,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,OAAO,wCAavC,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAC9D,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAA"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAA;AAEnE,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,eAAO,MAAM,SAAS,UAAW,OAAO,WAAU,SAAS,WAG1D,CAAA;AAED,eAAO,MAAM,SAAS,UAAW,OAAO,wCAEvC,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;AAC9D,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/assert.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAA;AAElF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAA;AAE5D,eAAO,MAAM,WAAW,UAAW,OAAO,UAAU,YAAY,GAAG,SAAS,kBAAkB,MAAM,cAQnG,CAAA"}
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/assert.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAA;AAElF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAA;AAE5D,eAAO,MAAM,WAAW,UAAW,OAAO,UAAU,YAAY,GAAG,SAAS,kBAAkB,MAAM,cASnG,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/assert.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAA;AAElF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAA;AAE5D,eAAO,MAAM,WAAW,UAAW,OAAO,UAAU,YAAY,GAAG,SAAS,kBAAkB,MAAM,cAQnG,CAAA"}
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/assert.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAA;AAElF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAA;AAE5D,eAAO,MAAM,WAAW,UAAW,OAAO,UAAU,YAAY,GAAG,SAAS,kBAAkB,MAAM,cASnG,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/assert.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAA;AAElF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAA;AAE5D,eAAO,MAAM,WAAW,UAAW,OAAO,UAAU,YAAY,GAAG,SAAS,kBAAkB,MAAM,cAQnG,CAAA"}
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/assert.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAA;AAElF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAA;AAE5D,eAAO,MAAM,WAAW,UAAW,OAAO,UAAU,YAAY,GAAG,SAAS,kBAAkB,MAAM,cASnG,CAAA"}
@@ -1,7 +1,6 @@
1
- import { HexConfig } from './model';
1
+ import { HexConfig } from '../model';
2
2
  export declare const hexFromArrayBuffer: (buffer: ArrayBuffer, config?: HexConfig) => string;
3
3
  export declare const hexFromBigInt: (value: bigint, config?: HexConfig) => string;
4
4
  export declare const hexFromNumber: (value: number, config?: HexConfig) => string;
5
- export declare const hexFromHexString: (value: string, config?: HexConfig) => string;
6
5
  export declare const hexFrom: (value: unknown, config?: HexConfig) => string;
7
6
  //# sourceMappingURL=from.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/from.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAIpC,eAAO,MAAM,kBAAkB,WAAY,WAAW,WAAW,SAAS,KAAG,MAG5E,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAAU,SAAS,KAAQ,MAKrE,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAAW,SAAS,KAAG,MAEjE,CAAA;AAED,eAAO,MAAM,OAAO,UAAW,OAAO,WAAW,SAAS,KAAG,MAsB5D,CAAA"}
@@ -1,7 +1,6 @@
1
- import { HexConfig } from './model';
1
+ import { HexConfig } from '../model';
2
2
  export declare const hexFromArrayBuffer: (buffer: ArrayBuffer, config?: HexConfig) => string;
3
3
  export declare const hexFromBigInt: (value: bigint, config?: HexConfig) => string;
4
4
  export declare const hexFromNumber: (value: number, config?: HexConfig) => string;
5
- export declare const hexFromHexString: (value: string, config?: HexConfig) => string;
6
5
  export declare const hexFrom: (value: unknown, config?: HexConfig) => string;
7
6
  //# sourceMappingURL=from.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/from.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAIpC,eAAO,MAAM,kBAAkB,WAAY,WAAW,WAAW,SAAS,KAAG,MAG5E,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAAU,SAAS,KAAQ,MAKrE,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAAW,SAAS,KAAG,MAEjE,CAAA;AAED,eAAO,MAAM,OAAO,UAAW,OAAO,WAAW,SAAS,KAAG,MAsB5D,CAAA"}
@@ -1,7 +1,6 @@
1
- import { HexConfig } from './model';
1
+ import { HexConfig } from '../model';
2
2
  export declare const hexFromArrayBuffer: (buffer: ArrayBuffer, config?: HexConfig) => string;
3
3
  export declare const hexFromBigInt: (value: bigint, config?: HexConfig) => string;
4
4
  export declare const hexFromNumber: (value: number, config?: HexConfig) => string;
5
- export declare const hexFromHexString: (value: string, config?: HexConfig) => string;
6
5
  export declare const hexFrom: (value: unknown, config?: HexConfig) => string;
7
6
  //# sourceMappingURL=from.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/from.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAIpC,eAAO,MAAM,kBAAkB,WAAY,WAAW,WAAW,SAAS,KAAG,MAG5E,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAAU,SAAS,KAAQ,MAKrE,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAAW,SAAS,KAAG,MAEjE,CAAA;AAED,eAAO,MAAM,OAAO,UAAW,OAAO,WAAW,SAAS,KAAG,MAsB5D,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { HexConfig } from '../model';
2
+ export declare const hexFromHexString: (value: string, config?: HexConfig) => string;
3
+ //# sourceMappingURL=fromHexString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromHexString.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromHexString.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGpC,eAAO,MAAM,gBAAgB,UAAW,MAAM,WAAU,SAAS,KAAQ,MAUxE,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { HexConfig } from '../model';
2
+ export declare const hexFromHexString: (value: string, config?: HexConfig) => string;
3
+ //# sourceMappingURL=fromHexString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromHexString.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromHexString.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGpC,eAAO,MAAM,gBAAgB,UAAW,MAAM,WAAU,SAAS,KAAQ,MAUxE,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { HexConfig } from '../model';
2
+ export declare const hexFromHexString: (value: string, config?: HexConfig) => string;
3
+ //# sourceMappingURL=fromHexString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromHexString.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromHexString.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGpC,eAAO,MAAM,gBAAgB,UAAW,MAAM,WAAU,SAAS,KAAQ,MAUxE,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './from';
2
+ export * from './fromHexString';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './from';
2
+ export * from './fromHexString';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './from';
2
+ export * from './fromHexString';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,iBAAiB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './as';
2
2
  export * from './from';
3
3
  export * from './is';
4
+ export * from './isHexZero';
4
5
  export * from './legacy';
5
6
  export * from './model';
6
7
  export * from './nibble';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hex/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,QAAQ,CAAA;AACtB,cAAc,MAAM,CAAA;AACpB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hex/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,QAAQ,CAAA;AACtB,cAAc,MAAM,CAAA;AACpB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './as';
2
2
  export * from './from';
3
3
  export * from './is';
4
+ export * from './isHexZero';
4
5
  export * from './legacy';
5
6
  export * from './model';
6
7
  export * from './nibble';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hex/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,QAAQ,CAAA;AACtB,cAAc,MAAM,CAAA;AACpB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hex/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,QAAQ,CAAA;AACtB,cAAc,MAAM,CAAA;AACpB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './as';
2
2
  export * from './from';
3
3
  export * from './is';
4
+ export * from './isHexZero';
4
5
  export * from './legacy';
5
6
  export * from './model';
6
7
  export * from './nibble';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hex/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,QAAQ,CAAA;AACtB,cAAc,MAAM,CAAA;AACpB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hex/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,QAAQ,CAAA;AACtB,cAAc,MAAM,CAAA;AACpB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -1,3 +1,3 @@
1
- export declare const isHexZero: (value: string) => boolean;
2
- export declare const isHex: (value: unknown, bitLength?: number) => value is string;
1
+ import { HexConfig } from './model';
2
+ export declare const isHex: (value: unknown, config?: HexConfig) => value is string;
3
3
  //# sourceMappingURL=is.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hex/is.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,UAAW,MAAM,YAEtC,CAAA;AAED,eAAO,MAAM,KAAK,UAAW,OAAO,cAAc,MAAM,oBASvD,CAAA"}
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hex/is.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,SAAS,CAAA;AAIxC,eAAO,MAAM,KAAK,UAAW,OAAO,WAAW,SAAS,oBAWvD,CAAA"}
@@ -1,3 +1,3 @@
1
- export declare const isHexZero: (value: string) => boolean;
2
- export declare const isHex: (value: unknown, bitLength?: number) => value is string;
1
+ import { HexConfig } from './model';
2
+ export declare const isHex: (value: unknown, config?: HexConfig) => value is string;
3
3
  //# sourceMappingURL=is.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hex/is.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,UAAW,MAAM,YAEtC,CAAA;AAED,eAAO,MAAM,KAAK,UAAW,OAAO,cAAc,MAAM,oBASvD,CAAA"}
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hex/is.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,SAAS,CAAA;AAIxC,eAAO,MAAM,KAAK,UAAW,OAAO,WAAW,SAAS,oBAWvD,CAAA"}
@@ -1,3 +1,3 @@
1
- export declare const isHexZero: (value: string) => boolean;
2
- export declare const isHex: (value: unknown, bitLength?: number) => value is string;
1
+ import { HexConfig } from './model';
2
+ export declare const isHex: (value: unknown, config?: HexConfig) => value is string;
3
3
  //# sourceMappingURL=is.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hex/is.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,UAAW,MAAM,YAEtC,CAAA;AAED,eAAO,MAAM,KAAK,UAAW,OAAO,cAAc,MAAM,oBASvD,CAAA"}
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hex/is.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,SAAS,CAAA;AAIxC,eAAO,MAAM,KAAK,UAAW,OAAO,WAAW,SAAS,oBAWvD,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const isHexZero: (value?: string) => boolean | undefined;
2
+ //# sourceMappingURL=isHexZero.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHexZero.d.ts","sourceRoot":"","sources":["../../../src/hex/isHexZero.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,WAAY,MAAM,wBAEvC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const isHexZero: (value?: string) => boolean | undefined;
2
+ //# sourceMappingURL=isHexZero.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHexZero.d.ts","sourceRoot":"","sources":["../../../src/hex/isHexZero.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,WAAY,MAAM,wBAEvC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const isHexZero: (value?: string) => boolean | undefined;
2
+ //# sourceMappingURL=isHexZero.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHexZero.d.ts","sourceRoot":"","sources":["../../../src/hex/isHexZero.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,WAAY,MAAM,wBAEvC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/hex/regex.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,QAAiB,CAAA;AACtC,eAAO,MAAM,kBAAkB,QAAkB,CAAA"}
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/hex/regex.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,QAAgB,CAAA;AACrC,eAAO,MAAM,kBAAkB,QAAiB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/hex/regex.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,QAAiB,CAAA;AACtC,eAAO,MAAM,kBAAkB,QAAkB,CAAA"}
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/hex/regex.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,QAAgB,CAAA;AACrC,eAAO,MAAM,kBAAkB,QAAiB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/hex/regex.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,QAAiB,CAAA;AACtC,eAAO,MAAM,kBAAkB,QAAkB,CAAA"}
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../../src/hex/regex.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,QAAgB,CAAA;AACrC,eAAO,MAAM,kBAAkB,QAAiB,CAAA"}