@xylabs/hex 5.0.4 → 5.0.6

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 (87) hide show
  1. package/dist/neutral/address/AddressTransformZod.d.ts +8 -0
  2. package/dist/neutral/address/AddressTransformZod.d.ts.map +1 -0
  3. package/dist/neutral/address/AddressValidationZod.d.ts +8 -0
  4. package/dist/neutral/address/AddressValidationZod.d.ts.map +1 -0
  5. package/dist/neutral/address/address.d.ts +7 -22
  6. package/dist/neutral/address/address.d.ts.map +1 -1
  7. package/dist/neutral/address/addressDeprecated.d.ts +18 -0
  8. package/dist/neutral/address/addressDeprecated.d.ts.map +1 -0
  9. package/dist/neutral/address/as.d.ts +7 -0
  10. package/dist/neutral/address/as.d.ts.map +1 -0
  11. package/dist/neutral/address/index.d.ts +6 -2
  12. package/dist/neutral/address/index.d.ts.map +1 -1
  13. package/dist/neutral/address/is.d.ts +6 -0
  14. package/dist/neutral/address/is.d.ts.map +1 -0
  15. package/dist/neutral/address/to.d.ts +6 -0
  16. package/dist/neutral/address/to.d.ts.map +1 -0
  17. package/dist/neutral/ethAddress.d.ts +4 -0
  18. package/dist/neutral/ethAddress.d.ts.map +1 -1
  19. package/dist/neutral/hash/as.d.ts +5 -0
  20. package/dist/neutral/hash/as.d.ts.map +1 -0
  21. package/dist/neutral/hash/hash.d.ts +14 -0
  22. package/dist/neutral/hash/hash.d.ts.map +1 -0
  23. package/dist/neutral/hash/index.d.ts +4 -0
  24. package/dist/neutral/hash/index.d.ts.map +1 -0
  25. package/dist/neutral/hash/is.d.ts +3 -0
  26. package/dist/neutral/hash/is.d.ts.map +1 -0
  27. package/dist/neutral/hex/as.d.ts +1 -1
  28. package/dist/neutral/hex/as.d.ts.map +1 -1
  29. package/dist/neutral/hex/from/from.d.ts +1 -1
  30. package/dist/neutral/hex/from/from.d.ts.map +1 -1
  31. package/dist/neutral/hex/from/fromArrayBuffer.d.ts +1 -1
  32. package/dist/neutral/hex/from/fromArrayBuffer.d.ts.map +1 -1
  33. package/dist/neutral/hex/from/fromBigInt.d.ts +1 -1
  34. package/dist/neutral/hex/from/fromBigInt.d.ts.map +1 -1
  35. package/dist/neutral/hex/from/fromHexString.d.ts +1 -1
  36. package/dist/neutral/hex/from/fromHexString.d.ts.map +1 -1
  37. package/dist/neutral/hex/from/fromNumber.d.ts +1 -1
  38. package/dist/neutral/hex/from/fromNumber.d.ts.map +1 -1
  39. package/dist/neutral/hex/{model.d.ts → hex.d.ts} +4 -5
  40. package/dist/neutral/hex/hex.d.ts.map +1 -0
  41. package/dist/neutral/hex/index.d.ts +1 -1
  42. package/dist/neutral/hex/index.d.ts.map +1 -1
  43. package/dist/neutral/hex/is.d.ts +1 -1
  44. package/dist/neutral/hex/is.d.ts.map +1 -1
  45. package/dist/neutral/hex/to.d.ts +4 -2
  46. package/dist/neutral/hex/to.d.ts.map +1 -1
  47. package/dist/neutral/index-internal.d.ts +1 -1
  48. package/dist/neutral/index-internal.d.ts.map +1 -1
  49. package/dist/neutral/index-internal.mjs +94 -62
  50. package/dist/neutral/index-internal.mjs.map +1 -1
  51. package/dist/neutral/index.mjs +94 -62
  52. package/dist/neutral/index.mjs.map +1 -1
  53. package/package.json +4 -4
  54. package/src/address/AddressTransformZod.ts +26 -0
  55. package/src/address/{AddressZodValidation.ts → AddressValidationZod.ts} +2 -2
  56. package/src/address/address.ts +6 -76
  57. package/src/address/addressDeprecated.ts +18 -0
  58. package/src/address/as.ts +37 -0
  59. package/src/address/index.ts +6 -2
  60. package/src/address/is.ts +14 -0
  61. package/src/address/to.ts +18 -0
  62. package/src/ethAddress.ts +9 -2
  63. package/src/hash/as.ts +24 -0
  64. package/src/hash/hash.ts +23 -0
  65. package/src/hash/index.ts +3 -0
  66. package/src/hash/is.ts +6 -0
  67. package/src/hex/as.ts +1 -1
  68. package/src/hex/from/from.ts +1 -1
  69. package/src/hex/from/fromArrayBuffer.ts +1 -1
  70. package/src/hex/from/fromBigInt.ts +1 -1
  71. package/src/hex/from/fromHexString.ts +1 -1
  72. package/src/hex/from/fromNumber.ts +1 -1
  73. package/src/hex/{model.ts → hex.ts} +3 -6
  74. package/src/hex/index.ts +1 -1
  75. package/src/hex/is.ts +1 -1
  76. package/src/hex/to.ts +1 -1
  77. package/src/index-internal.ts +1 -1
  78. package/src/spec/hash.spec.ts +1 -1
  79. package/dist/neutral/address/AddressZodTransform.d.ts +0 -5
  80. package/dist/neutral/address/AddressZodTransform.d.ts.map +0 -1
  81. package/dist/neutral/address/AddressZodValidation.d.ts +0 -5
  82. package/dist/neutral/address/AddressZodValidation.d.ts.map +0 -1
  83. package/dist/neutral/hash.d.ts +0 -17
  84. package/dist/neutral/hash.d.ts.map +0 -1
  85. package/dist/neutral/hex/model.d.ts.map +0 -1
  86. package/src/address/AddressZodTransform.ts +0 -19
  87. package/src/hash.ts +0 -51
@@ -0,0 +1,8 @@
1
+ import z from 'zod';
2
+ export declare const AddressTransformZod: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodBigInt, z.ZodNumber]>, z.ZodTransform<string, string | number | bigint>>, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
3
+ readonly __hex: true;
4
+ }>, {
5
+ readonly __address: true;
6
+ }>, string>>;
7
+ export type AddressTransformZodType = z.infer<typeof AddressTransformZod>;
8
+ //# sourceMappingURL=AddressTransformZod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddressTransformZod.d.ts","sourceRoot":"","sources":["../../../src/address/AddressTransformZod.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAKnB,eAAO,MAAM,mBAAmB;;;;YAkBD,CAAA;AAE/B,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import z from 'zod';
2
+ export declare const AddressValidationZod: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
3
+ readonly __hex: true;
4
+ }>, {
5
+ readonly __address: true;
6
+ }>, string>>;
7
+ export type AddressValidationZodType = z.infer<typeof AddressValidationZod>;
8
+ //# sourceMappingURL=AddressValidationZod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddressValidationZod.d.ts","sourceRoot":"","sources":["../../../src/address/AddressValidationZod.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAMnB,eAAO,MAAM,oBAAoB;;;;YAGF,CAAA;AAE/B,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
@@ -1,26 +1,11 @@
1
+ import type { Brand } from '@xylabs/typeof';
1
2
  import z from 'zod';
2
- import type { AssertConfig } from '../assert.ts';
3
- import type { Hex, HexConfig } from '../hex/index.ts';
4
- export type Address = Hex & {
5
- readonly __address: true;
6
- };
7
- export declare const AddressRegEx: RegExp;
8
- export declare const AddressToStringZod: z.ZodString;
9
- /** @deprecated use AddressToStringZod */
10
- export declare const AddressToStringSchema: z.ZodString;
11
- export declare const AddressFromStringZod: z.ZodPipe<z.ZodString, z.ZodTransform<Address, string>>;
12
- /** @deprecated use AddressFromStringZod */
13
- export declare const AddressFromStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<Address, string>>;
3
+ import type { Hex } from '../hex/index.ts';
14
4
  export declare const ZERO_ADDRESS: Address;
15
5
  export declare const ADDRESS_LENGTH: 40;
16
- export declare const toAddress: (value: string | number | bigint | ArrayBufferLike, config?: HexConfig) => Address;
17
- export declare const isAddress: (value: unknown, config?: HexConfig) => value is Address;
18
- export declare function asAddress(value: unknown): Address | undefined;
19
- export declare function asAddress(value: unknown, assert: AssertConfig): Address;
20
- /** @alpha */
21
- export declare function isAddressV2(value: unknown): value is Address;
22
- /** @alpha */
23
- export declare function asAddressV2(value: unknown, assert?: boolean): Address | undefined;
24
- /** @alpha */
25
- export declare function toAddressV2(value: unknown, assert?: boolean): Address | undefined;
6
+ export declare const AddressRegEx: RegExp;
7
+ export declare const AddressZod: z.ZodType<Brand<Hex, {
8
+ readonly __address: true;
9
+ }>>;
10
+ export type Address = z.infer<typeof AddressZod>;
26
11
  //# sourceMappingURL=address.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src/address/address.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AASrD,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG;IAC1B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,YAAY,QAAyB,CAAA;AAElD,eAAO,MAAM,kBAAkB,aAAiC,CAAA;AAEhE,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,aAAqB,CAAA;AAEvD,eAAO,MAAM,oBAAoB,yDAA4E,CAAA;AAE7G,2CAA2C;AAC3C,eAAO,MAAM,uBAAuB,yDAAuB,CAAA;AAE3D,eAAO,MAAM,YAAY,EAAiD,OAAO,CAAA;AACjF,eAAO,MAAM,cAAc,EAAG,EAAW,CAAA;AAEzC,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,EAAE,SAAQ,SAAc,KAAG,OAKrG,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,EAAE,SAAQ,SAAc,KAAG,KAAK,IAAI,OAG3E,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;AAqBxE,aAAa;AACb,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE5D;AAED,aAAa;AACb,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,GAAG,SAAS,CAIxF;AAED,aAAa;AACb,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,GAAG,SAAS,CAIxF"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src/address/address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAG1C,eAAO,MAAM,YAAY,EAAiD,OAAO,CAAA;AACjF,eAAO,MAAM,cAAc,EAAG,EAAW,CAAA;AAEzC,eAAO,MAAM,YAAY,QAAyD,CAAA;AAElF,eAAO,MAAM,UAAU,EACiD,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC,CAAA;AAE3H,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import z from 'zod';
2
+ /** @deprecated use AddressZod */
3
+ export declare const AddressToStringZod: z.ZodString;
4
+ /** @deprecated use AddressZod */
5
+ export declare const AddressToStringSchema: z.ZodString;
6
+ /** @deprecated use AddressZod */
7
+ export declare const AddressFromStringZod: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
8
+ readonly __hex: true;
9
+ }>, {
10
+ readonly __address: true;
11
+ }>, string>>;
12
+ /** @deprecated use AddressZod */
13
+ export declare const AddressFromStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
14
+ readonly __hex: true;
15
+ }>, {
16
+ readonly __address: true;
17
+ }>, string>>;
18
+ //# sourceMappingURL=addressDeprecated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addressDeprecated.d.ts","sourceRoot":"","sources":["../../../src/address/addressDeprecated.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAKnB,iCAAiC;AACjC,eAAO,MAAM,kBAAkB,aAAiC,CAAA;AAEhE,iCAAiC;AAEjC,eAAO,MAAM,qBAAqB,aAAqB,CAAA;AAEvD,iCAAiC;AACjC,eAAO,MAAM,oBAAoB;;;;YAA4E,CAAA;AAE7G,iCAAiC;AAEjC,eAAO,MAAM,uBAAuB;;;;YAAuB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { AssertConfig } from '../assert.ts';
2
+ import type { Address } from './address.ts';
3
+ export declare function asAddress(value: unknown): Address | undefined;
4
+ export declare function asAddress(value: unknown, assert: AssertConfig): Address;
5
+ /** @alpha */
6
+ export declare function asAddressV2(value: unknown, assert?: boolean): Address | undefined;
7
+ //# sourceMappingURL=as.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"as.d.ts","sourceRoot":"","sources":["../../../src/address/as.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAI3C,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;AAqBxE,aAAa;AACb,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,GAAG,SAAS,CAIxF"}
@@ -1,4 +1,8 @@
1
1
  export * from './address.ts';
2
- export * from './AddressZodTransform.ts';
3
- export * from './AddressZodValidation.ts';
2
+ export * from './addressDeprecated.ts';
3
+ export * from './AddressTransformZod.ts';
4
+ export * from './AddressValidationZod.ts';
5
+ export * from './as.ts';
6
+ export * from './is.ts';
7
+ export * from './to.ts';
4
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { HexConfig } from '../hex/index.ts';
2
+ import type { Address } from './address.ts';
3
+ export declare const isAddress: (value: unknown, config?: HexConfig) => value is Address;
4
+ /** @alpha */
5
+ export declare function isAddressV2(value: unknown): value is Address;
6
+ //# sourceMappingURL=is.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/address/is.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAG3C,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,EAAE,SAAQ,SAAc,KAAG,KAAK,IAAI,OAG3E,CAAA;AAED,aAAa;AACb,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE5D"}
@@ -0,0 +1,6 @@
1
+ import type { HexConfig } from '../hex/index.ts';
2
+ import type { Address } from './address.ts';
3
+ export declare const toAddress: (value: string | number | bigint | ArrayBufferLike, config?: HexConfig) => Address;
4
+ /** @alpha */
5
+ export declare function toAddressV2(value: unknown, assert?: boolean): Address | undefined;
6
+ //# sourceMappingURL=to.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to.d.ts","sourceRoot":"","sources":["../../../src/address/to.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAG3C,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,EAAE,SAAQ,SAAc,KAAG,OAKrG,CAAA;AAED,aAAa;AACb,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,GAAG,SAAS,CAIxF"}
@@ -3,7 +3,11 @@ import z from 'zod';
3
3
  import type { AssertConfig } from './assert.ts';
4
4
  import type { HexConfig } from './hex/index.ts';
5
5
  export declare const EthAddressRegEx: RegExp;
6
+ export declare const EthAddressToStringZod: z.ZodString;
7
+ /** @deprecated use EthAddressToStringZod */
6
8
  export declare const EthAddressToStringSchema: z.ZodString;
9
+ export declare const EthAddressFromStringZod: z.ZodPipe<z.ZodString, z.ZodTransform<EthAddress, string>>;
10
+ /** @deprecated use EthAddressFromStringZod */
7
11
  export declare const EthAddressFromStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<EthAddress, string>>;
8
12
  export type EthAddress = Brand<string, {
9
13
  readonly __eth_address: true;
@@ -1 +1 @@
1
- {"version":3,"file":"ethAddress.d.ts","sourceRoot":"","sources":["../../src/ethAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAM/C,eAAO,MAAM,eAAe,QAA4C,CAAA;AAExE,eAAO,MAAM,wBAAwB,aAAoC,CAAA;AACzE,eAAO,MAAM,0BAA0B,4DAAoE,CAAA;AAG3G,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAA;CAAE,CAAC,CAAA;AAExE,eAAO,MAAM,gBAAgB,EAAmD,UAAU,CAAA;AAE1F,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,EAAE,SAAQ,SAAc,KAAG,UAKxG,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,EAAE,SAAQ,SAAc,KAAG,KAAK,IAAI,UAG9E,CAAA;AAED,eAAO,MAAM,aAAa,aAIvB,CAAA;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AACpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,UAAU,CAAA"}
1
+ {"version":3,"file":"ethAddress.d.ts","sourceRoot":"","sources":["../../src/ethAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAM/C,eAAO,MAAM,eAAe,QAA4C,CAAA;AAExE,eAAO,MAAM,qBAAqB,aAAoC,CAAA;AAEtE,4CAA4C;AAC5C,eAAO,MAAM,wBAAwB,aAAwB,CAAA;AAE7D,eAAO,MAAM,uBAAuB,4DAAoE,CAAA;AAExG,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,4DAA0B,CAAA;AAGjE,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAA;CAAE,CAAC,CAAA;AAExE,eAAO,MAAM,gBAAgB,EAAmD,UAAU,CAAA;AAE1F,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe,EAAE,SAAQ,SAAc,KAAG,UAKxG,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,EAAE,SAAQ,SAAc,KAAG,KAAK,IAAI,UAG9E,CAAA;AAED,eAAO,MAAM,aAAa,aAIvB,CAAA;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AACpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,UAAU,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { AssertConfig } from '../assert.ts';
2
+ import { type Hash } from './hash.ts';
3
+ export declare function asHash(value: unknown): Hash | undefined;
4
+ export declare function asHash(value: unknown, assert: AssertConfig): Hash;
5
+ //# sourceMappingURL=as.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"as.d.ts","sourceRoot":"","sources":["../../../src/hash/as.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGhD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAA;AAGrC,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;AACxD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { Brand } from '@xylabs/typeof';
2
+ import z from 'zod';
3
+ import type { Hex } from '../hex/index.ts';
4
+ export declare const HASH_LENGTH: 32;
5
+ export declare const HashRegEx: RegExp;
6
+ export declare const ZERO_HASH: Hash;
7
+ export type HashBitLength = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096;
8
+ export declare const HashBitLength: HashBitLength[];
9
+ export declare const isHashBitLength: (value: unknown) => value is HashBitLength;
10
+ export declare const HashZod: z.ZodType<Brand<Hex, {
11
+ readonly __hash: true;
12
+ }>>;
13
+ export type Hash = z.infer<typeof HashZod>;
14
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../src/hash/hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAG1C,eAAO,MAAM,WAAW,EAAG,EAAW,CAAA;AAEtC,eAAO,MAAM,SAAS,QAA2C,CAAA;AAEjE,eAAO,MAAM,SAAS,EAAyE,IAAI,CAAA;AAEnG,MAAM,MAAM,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAC1E,eAAO,MAAM,aAAa,EAAE,aAAa,EAA8C,CAAA;AAEvF,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,aAEzD,CAAA;AAED,eAAO,MAAM,OAAO,EACiD,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC,CAAA;AAErH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './as.ts';
2
+ export * from './hash.ts';
3
+ export * from './is.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hash/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Hash, HashBitLength } from './hash.ts';
2
+ export declare const isHash: (value: unknown, bitLength?: HashBitLength) => value is Hash;
3
+ //# sourceMappingURL=is.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hash/is.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,MAAM,GAAI,OAAO,OAAO,EAAE,YAAW,aAAmB,KAAG,KAAK,IAAI,IAEhF,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { AssertConfig } from '../assert.ts';
2
- import type { Hex } from './model.ts';
2
+ import type { Hex } from './hex.ts';
3
3
  export declare function asHex(value: unknown): Hex | undefined;
4
4
  export declare function asHex(value: unknown, assert: AssertConfig): Hex;
5
5
  //# sourceMappingURL=as.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"as.d.ts","sourceRoot":"","sources":["../../../src/hex/as.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAIhD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAErC,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,GAAG,SAAS,CAAA;AACtD,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,GAAG,CAAA"}
1
+ {"version":3,"file":"as.d.ts","sourceRoot":"","sources":["../../../src/hex/as.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGhD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnC,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,GAAG,SAAS,CAAA;AACtD,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,GAAG,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Hex, HexConfig } from '../model.ts';
1
+ import type { Hex, HexConfig } from '../hex.ts';
2
2
  /** Takes unknown value and tries our best to convert it to a hex string */
3
3
  export declare const hexFrom: (
4
4
  /** Supported types are string, number, bigint, and ArrayBuffer */
@@ -1 +1 @@
1
- {"version":3,"file":"from.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/from.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAMjD,2EAA2E;AAC3E,eAAO,MAAM,OAAO;AAClB,kEAAkE;AAClE,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe;AACjD,oDAAoD;AACpD,SAAS,SAAS,KACjB,GAkBF,CAAA"}
1
+ {"version":3,"file":"from.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/from.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAM/C,2EAA2E;AAC3E,eAAO,MAAM,OAAO;AAClB,kEAAkE;AAClE,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe;AACjD,oDAAoD;AACpD,SAAS,SAAS,KACjB,GAkBF,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Hex, HexConfig } from '../model.ts';
1
+ import type { Hex, HexConfig } from '../hex.ts';
2
2
  /** Convert an ArrayBuffer to a hex string */
3
3
  export declare const hexFromArrayBuffer: (
4
4
  /** The buffer to be converted */
@@ -1 +1 @@
1
- {"version":3,"file":"fromArrayBuffer.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromArrayBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGjD,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB;AAC7B,iCAAiC;AACjC,QAAQ,eAAe;AACvB,oDAAoD;AACpD,SAAS,SAAS,KACjB,GAGF,CAAA"}
1
+ {"version":3,"file":"fromArrayBuffer.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromArrayBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAG/C,6CAA6C;AAC7C,eAAO,MAAM,kBAAkB;AAC7B,iCAAiC;AACjC,QAAQ,eAAe;AACvB,oDAAoD;AACpD,SAAS,SAAS,KACjB,GAGF,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Hex, HexConfig } from '../model.ts';
1
+ import type { Hex, HexConfig } from '../hex.ts';
2
2
  /** Convert a bigint to a hex string */
3
3
  export declare const hexFromBigInt: (
4
4
  /** The bigint to be converted */
@@ -1 +1 @@
1
- {"version":3,"file":"fromBigInt.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromBigInt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGjD,uCAAuC;AACvC,eAAO,MAAM,aAAa;AACxB,iCAAiC;AACjC,OAAO,MAAM;AACb,oDAAoD;AACpD,SAAQ,SAAc,KACrB,GAGF,CAAA"}
1
+ {"version":3,"file":"fromBigInt.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromBigInt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAG/C,uCAAuC;AACvC,eAAO,MAAM,aAAa;AACxB,iCAAiC;AACjC,OAAO,MAAM;AACb,oDAAoD;AACpD,SAAQ,SAAc,KACrB,GAGF,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { Hex, HexConfig } from '../model.ts';
1
+ import type { Hex, HexConfig } from '../hex.ts';
2
2
  export declare const hexFromHexString: (value: string, config?: HexConfig) => Hex;
3
3
  //# sourceMappingURL=fromHexString.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fromHexString.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromHexString.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGjD,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,EAAE,SAAQ,SAAc,KAAG,GAaxE,CAAA"}
1
+ {"version":3,"file":"fromHexString.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromHexString.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAI/C,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,EAAE,SAAQ,SAAc,KAAG,GAaxE,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { Hex, HexConfig } from '../model.ts';
1
+ import type { Hex, HexConfig } from '../hex.ts';
2
2
  export declare const hexFromNumber: (value: number, config?: HexConfig) => Hex;
3
3
  //# sourceMappingURL=fromNumber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fromNumber.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGjD,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,SAAS,SAAS,KAAG,GAEjE,CAAA"}
1
+ {"version":3,"file":"fromNumber.d.ts","sourceRoot":"","sources":["../../../../src/hex/from/fromNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAG/C,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,SAAS,SAAS,KAAG,GAEjE,CAAA"}
@@ -1,14 +1,13 @@
1
1
  import type { Brand } from '@xylabs/typeof';
2
2
  import z from 'zod';
3
- export type Hex = Brand<Lowercase<string>, {
3
+ export declare const HexZod: z.ZodType<Brand<Lowercase<string>, {
4
4
  readonly __hex: true;
5
- }>;
6
- export declare const HexZod: z.ZodPipe<z.ZodString, z.ZodTransform<Hex, string>>;
5
+ }>>;
6
+ export type Hex = z.infer<typeof HexZod>;
7
7
  /** Configuration of validation and output format */
8
8
  export interface HexConfig {
9
9
  bitLength?: number;
10
10
  byteSize?: number;
11
11
  prefix?: boolean;
12
12
  }
13
- export type HexZodType = z.infer<typeof HexZod>;
14
- //# sourceMappingURL=model.d.ts.map
13
+ //# sourceMappingURL=hex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../src/hex/hex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,eAAO,MAAM,MAAM,EACiD,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC,CAAA;AAEjI,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAA;AAExC,oDAAoD;AACpD,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB"}
@@ -1,9 +1,9 @@
1
1
  export * from './as.ts';
2
2
  export * from './from/index.ts';
3
+ export * from './hex.ts';
3
4
  export * from './is.ts';
4
5
  export * from './isHexZero.ts';
5
6
  export * from './legacy.ts';
6
- export * from './model.ts';
7
7
  export * from './nibble.ts';
8
8
  export * from './to.ts';
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hex/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hex/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { Hex, HexConfig } from './model.ts';
1
+ import type { Hex, HexConfig } from './hex.ts';
2
2
  export declare const isHex: (value: unknown, config?: HexConfig) => value is Hex;
3
3
  //# sourceMappingURL=is.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hex/is.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAGhD,eAAO,MAAM,KAAK,GAAI,OAAO,OAAO,EAAE,SAAS,SAAS,KAAG,KAAK,IAAI,GAWnE,CAAA"}
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/hex/is.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAG9C,eAAO,MAAM,KAAK,GAAI,OAAO,OAAO,EAAE,SAAS,SAAS,KAAG,KAAK,IAAI,GAWnE,CAAA"}
@@ -1,8 +1,10 @@
1
- import type { HexConfig } from './model.ts';
1
+ import type { HexConfig } from './hex.ts';
2
2
  /** takes any value and tries our best to convert it to a hex string */
3
3
  export declare const toHex: (
4
4
  /** Supported types are string, number, bigint, and ArrayBuffer */
5
5
  value: string | number | bigint | ArrayBufferLike,
6
6
  /** Configuration of output format and validation */
7
- config?: HexConfig) => import("./model.ts").Hex;
7
+ config?: HexConfig) => import("@xylabs/typeof").Brand<Lowercase<string>, {
8
+ readonly __hex: true;
9
+ }>;
8
10
  //# sourceMappingURL=to.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"to.d.ts","sourceRoot":"","sources":["../../../src/hex/to.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,uEAAuE;AACvE,eAAO,MAAM,KAAK;AAChB,kEAAkE;AAClE,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe;AACjD,oDAAoD;AACpD,SAAQ,SAAc,6BAIvB,CAAA"}
1
+ {"version":3,"file":"to.d.ts","sourceRoot":"","sources":["../../../src/hex/to.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,uEAAuE;AACvE,eAAO,MAAM,KAAK;AAChB,kEAAkE;AAClE,OAAO,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,eAAe;AACjD,oDAAoD;AACpD,SAAQ,SAAc;;EAIvB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  export * from './address/index.ts';
2
2
  export * from './assert.ts';
3
3
  export * from './ethAddress.ts';
4
- export * from './hash.ts';
4
+ export * from './hash/index.ts';
5
5
  export * from './hex/index.ts';
6
6
  export * from './HexRegEx.ts';
7
7
  export * from './hexToBigInt.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index-internal.d.ts","sourceRoot":"","sources":["../../src/index-internal.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index-internal.d.ts","sourceRoot":"","sources":["../../src/index-internal.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}