inray 0.0.2 → 0.0.4

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 (257) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +220 -36
  3. package/dist/async/abortable.d.ts +2 -2
  4. package/dist/async/abortable.d.ts.map +1 -1
  5. package/dist/async/abortable.js.map +1 -1
  6. package/dist/caching/mod.d.ts +2 -0
  7. package/dist/caching/mod.d.ts.map +1 -0
  8. package/dist/caching/mod.js +2 -0
  9. package/dist/caching/mod.js.map +1 -0
  10. package/dist/caching/src/cache.d.ts +89 -0
  11. package/dist/caching/src/cache.d.ts.map +1 -0
  12. package/dist/caching/src/cache.js +309 -0
  13. package/dist/caching/src/cache.js.map +1 -0
  14. package/dist/caching/src/hashing/cache.d.ts +92 -0
  15. package/dist/caching/src/hashing/cache.d.ts.map +1 -0
  16. package/dist/caching/src/hashing/cache.js +119 -0
  17. package/dist/caching/src/hashing/cache.js.map +1 -0
  18. package/dist/caching/src/hashing/hooks/eventified.d.ts +157 -0
  19. package/dist/caching/src/hashing/hooks/eventified.d.ts.map +1 -0
  20. package/dist/caching/src/hashing/hooks/eventified.js +333 -0
  21. package/dist/caching/src/hashing/hooks/eventified.js.map +1 -0
  22. package/dist/caching/src/hashing/hooks/index.d.ts +199 -0
  23. package/dist/caching/src/hashing/hooks/index.d.ts.map +1 -0
  24. package/dist/caching/src/hashing/hooks/index.js +383 -0
  25. package/dist/caching/src/hashing/hooks/index.js.map +1 -0
  26. package/dist/caching/src/hashing/hooks/types.d.ts +217 -0
  27. package/dist/caching/src/hashing/hooks/types.d.ts.map +1 -0
  28. package/dist/caching/src/hashing/hooks/types.js +10 -0
  29. package/dist/caching/src/hashing/hooks/types.js.map +1 -0
  30. package/dist/caching/src/hashing/index.d.ts +236 -0
  31. package/dist/caching/src/hashing/index.d.ts.map +1 -0
  32. package/dist/caching/src/hashing/index.js +447 -0
  33. package/dist/caching/src/hashing/index.js.map +1 -0
  34. package/dist/caching/src/hashing/providers/crc.d.ts +15 -0
  35. package/dist/caching/src/hashing/providers/crc.d.ts.map +1 -0
  36. package/dist/caching/src/hashing/providers/crc.js +49 -0
  37. package/dist/caching/src/hashing/providers/crc.js.map +1 -0
  38. package/dist/caching/src/hashing/providers/crypto.d.ts +19 -0
  39. package/dist/caching/src/hashing/providers/crypto.d.ts.map +1 -0
  40. package/dist/caching/src/hashing/providers/crypto.js +28 -0
  41. package/dist/caching/src/hashing/providers/crypto.js.map +1 -0
  42. package/dist/caching/src/hashing/providers/djb2.d.ts +60 -0
  43. package/dist/caching/src/hashing/providers/djb2.d.ts.map +1 -0
  44. package/dist/caching/src/hashing/providers/djb2.js +92 -0
  45. package/dist/caching/src/hashing/providers/djb2.js.map +1 -0
  46. package/dist/caching/src/hashing/providers/fnv1.d.ts +33 -0
  47. package/dist/caching/src/hashing/providers/fnv1.d.ts.map +1 -0
  48. package/dist/caching/src/hashing/providers/fnv1.js +68 -0
  49. package/dist/caching/src/hashing/providers/fnv1.js.map +1 -0
  50. package/dist/caching/src/hashing/providers/murmur.d.ts +81 -0
  51. package/dist/caching/src/hashing/providers/murmur.d.ts.map +1 -0
  52. package/dist/caching/src/hashing/providers/murmur.js +173 -0
  53. package/dist/caching/src/hashing/providers/murmur.js.map +1 -0
  54. package/dist/caching/src/hashing/providers.d.ts +126 -0
  55. package/dist/caching/src/hashing/providers.d.ts.map +1 -0
  56. package/dist/caching/src/hashing/providers.js +163 -0
  57. package/dist/caching/src/hashing/providers.js.map +1 -0
  58. package/dist/caching/src/hashing/types.d.ts +340 -0
  59. package/dist/caching/src/hashing/types.d.ts.map +1 -0
  60. package/dist/caching/src/hashing/types.js +10 -0
  61. package/dist/caching/src/hashing/types.js.map +1 -0
  62. package/dist/caching/src/keyValue/capabilities.d.ts +161 -0
  63. package/dist/caching/src/keyValue/capabilities.d.ts.map +1 -0
  64. package/dist/caching/src/keyValue/capabilities.js +334 -0
  65. package/dist/caching/src/keyValue/capabilities.js.map +1 -0
  66. package/dist/caching/src/keyValue/event-manager.d.ts +27 -0
  67. package/dist/caching/src/keyValue/event-manager.d.ts.map +1 -0
  68. package/dist/caching/src/keyValue/event-manager.js +88 -0
  69. package/dist/caching/src/keyValue/event-manager.js.map +1 -0
  70. package/dist/caching/src/keyValue/generic-store.d.ts +243 -0
  71. package/dist/caching/src/keyValue/generic-store.d.ts.map +1 -0
  72. package/dist/caching/src/keyValue/generic-store.js +295 -0
  73. package/dist/caching/src/keyValue/generic-store.js.map +1 -0
  74. package/dist/caching/src/keyValue/hooks-manager.d.ts +21 -0
  75. package/dist/caching/src/keyValue/hooks-manager.d.ts.map +1 -0
  76. package/dist/caching/src/keyValue/hooks-manager.js +59 -0
  77. package/dist/caching/src/keyValue/hooks-manager.js.map +1 -0
  78. package/dist/caching/src/keyValue/index.d.ts +334 -0
  79. package/dist/caching/src/keyValue/index.d.ts.map +1 -0
  80. package/dist/caching/src/keyValue/index.js +796 -0
  81. package/dist/caching/src/keyValue/index.js.map +1 -0
  82. package/dist/caching/src/keyValue/serialize/serialize.d.ts +12 -0
  83. package/dist/caching/src/keyValue/serialize/serialize.d.ts.map +1 -0
  84. package/dist/caching/src/keyValue/serialize/serialize.js +64 -0
  85. package/dist/caching/src/keyValue/serialize/serialize.js.map +1 -0
  86. package/dist/caching/src/keyValue/stats-manager.d.ts +27 -0
  87. package/dist/caching/src/keyValue/stats-manager.d.ts.map +1 -0
  88. package/dist/caching/src/keyValue/stats-manager.js +64 -0
  89. package/dist/caching/src/keyValue/stats-manager.js.map +1 -0
  90. package/dist/caching/src/keyValue/types.d.ts +22 -0
  91. package/dist/caching/src/keyValue/types.d.ts.map +1 -0
  92. package/dist/caching/src/keyValue/types.js +11 -0
  93. package/dist/caching/src/keyValue/types.js.map +1 -0
  94. package/dist/caching/src/keyv-adapter.d.ts +40 -0
  95. package/dist/caching/src/keyv-adapter.d.ts.map +1 -0
  96. package/dist/caching/src/keyv-adapter.js +56 -0
  97. package/dist/caching/src/keyv-adapter.js.map +1 -0
  98. package/dist/caching/src/utils/cache-tags.d.ts +275 -0
  99. package/dist/caching/src/utils/cache-tags.d.ts.map +1 -0
  100. package/dist/caching/src/utils/cache-tags.js +407 -0
  101. package/dist/caching/src/utils/cache-tags.js.map +1 -0
  102. package/dist/caching/src/utils/cacheable-item-types.d.ts +35 -0
  103. package/dist/caching/src/utils/cacheable-item-types.d.ts.map +1 -0
  104. package/dist/caching/src/utils/cacheable-item-types.js +10 -0
  105. package/dist/caching/src/utils/cacheable-item-types.js.map +1 -0
  106. package/dist/caching/src/utils/coalesce-async.d.ts +29 -0
  107. package/dist/caching/src/utils/coalesce-async.d.ts.map +1 -0
  108. package/dist/caching/src/utils/coalesce-async.js +88 -0
  109. package/dist/caching/src/utils/coalesce-async.js.map +1 -0
  110. package/dist/caching/src/utils/hash.d.ts +55 -0
  111. package/dist/caching/src/utils/hash.d.ts.map +1 -0
  112. package/dist/caching/src/utils/hash.js +116 -0
  113. package/dist/caching/src/utils/hash.js.map +1 -0
  114. package/dist/caching/src/utils/index.d.ts +24 -0
  115. package/dist/caching/src/utils/index.d.ts.map +1 -0
  116. package/dist/caching/src/utils/index.js +21 -0
  117. package/dist/caching/src/utils/index.js.map +1 -0
  118. package/dist/caching/src/utils/is-keyv-instance.d.ts +10 -0
  119. package/dist/caching/src/utils/is-keyv-instance.d.ts.map +1 -0
  120. package/dist/caching/src/utils/is-keyv-instance.js +37 -0
  121. package/dist/caching/src/utils/is-keyv-instance.js.map +1 -0
  122. package/dist/caching/src/utils/is-object.d.ts +10 -0
  123. package/dist/caching/src/utils/is-object.d.ts.map +1 -0
  124. package/dist/caching/src/utils/is-object.js +13 -0
  125. package/dist/caching/src/utils/is-object.js.map +1 -0
  126. package/dist/caching/src/utils/less-than.d.ts +10 -0
  127. package/dist/caching/src/utils/less-than.d.ts.map +1 -0
  128. package/dist/caching/src/utils/less-than.js +13 -0
  129. package/dist/caching/src/utils/less-than.js.map +1 -0
  130. package/dist/caching/src/utils/memoize.d.ts +107 -0
  131. package/dist/caching/src/utils/memoize.d.ts.map +1 -0
  132. package/dist/caching/src/utils/memoize.js +201 -0
  133. package/dist/caching/src/utils/memoize.js.map +1 -0
  134. package/dist/caching/src/utils/mock-cacheable.d.ts +28 -0
  135. package/dist/caching/src/utils/mock-cacheable.d.ts.map +1 -0
  136. package/dist/caching/src/utils/mock-cacheable.js +87 -0
  137. package/dist/caching/src/utils/mock-cacheable.js.map +1 -0
  138. package/dist/caching/src/utils/run-if-fn.d.ts +12 -0
  139. package/dist/caching/src/utils/run-if-fn.d.ts.map +1 -0
  140. package/dist/caching/src/utils/run-if-fn.js +12 -0
  141. package/dist/caching/src/utils/run-if-fn.js.map +1 -0
  142. package/dist/caching/src/utils/shorthand-time.d.ts +27 -0
  143. package/dist/caching/src/utils/shorthand-time.d.ts.map +1 -0
  144. package/dist/caching/src/utils/shorthand-time.js +96 -0
  145. package/dist/caching/src/utils/shorthand-time.js.map +1 -0
  146. package/dist/caching/src/utils/sleep.d.ts +10 -0
  147. package/dist/caching/src/utils/sleep.d.ts.map +1 -0
  148. package/dist/caching/src/utils/sleep.js +11 -0
  149. package/dist/caching/src/utils/sleep.js.map +1 -0
  150. package/dist/caching/src/utils/stats.d.ts +354 -0
  151. package/dist/caching/src/utils/stats.d.ts.map +1 -0
  152. package/dist/caching/src/utils/stats.js +593 -0
  153. package/dist/caching/src/utils/stats.js.map +1 -0
  154. package/dist/caching/src/utils/ttl.d.ts +58 -0
  155. package/dist/caching/src/utils/ttl.d.ts.map +1 -0
  156. package/dist/caching/src/utils/ttl.js +77 -0
  157. package/dist/caching/src/utils/ttl.js.map +1 -0
  158. package/dist/logtape/logtape/level.d.ts +1 -2
  159. package/dist/logtape/logtape/level.d.ts.map +1 -1
  160. package/dist/logtape/logtape/level.js +1 -1
  161. package/dist/logtape/logtape/level.js.map +1 -1
  162. package/dist/logtape/logtape/mod.d.ts +1 -1
  163. package/dist/logtape/logtape/mod.d.ts.map +1 -1
  164. package/dist/logtape/logtape/mod.js +1 -1
  165. package/dist/logtape/logtape/mod.js.map +1 -1
  166. package/dist/utils/mod.d.ts +1 -1
  167. package/dist/utils/mod.d.ts.map +1 -1
  168. package/dist/utils/mod.js.map +1 -1
  169. package/dist/utils/validation/inRangeOfMaxInt32.d.ts +2 -0
  170. package/dist/utils/validation/inRangeOfMaxInt32.d.ts.map +1 -0
  171. package/dist/utils/validation/inRangeOfMaxInt32.js +4 -0
  172. package/dist/utils/validation/inRangeOfMaxInt32.js.map +1 -0
  173. package/dist/utils/validation/isEmail.d.ts +2 -0
  174. package/dist/utils/validation/isEmail.d.ts.map +1 -0
  175. package/dist/utils/validation/isEmail.js +7 -0
  176. package/dist/utils/validation/isEmail.js.map +1 -0
  177. package/dist/utils/validation/isEmptyObject.d.ts +9 -0
  178. package/dist/utils/validation/isEmptyObject.d.ts.map +1 -0
  179. package/dist/utils/validation/isEmptyObject.js +16 -0
  180. package/dist/utils/validation/isEmptyObject.js.map +1 -0
  181. package/dist/utils/validation/isNotEmptyString.d.ts +7 -0
  182. package/dist/utils/validation/isNotEmptyString.d.ts.map +1 -0
  183. package/dist/utils/validation/isNotEmptyString.js +17 -0
  184. package/dist/utils/validation/isNotEmptyString.js.map +1 -0
  185. package/dist/utils/validation/isPositiveInteger.d.ts +2 -0
  186. package/dist/utils/validation/isPositiveInteger.d.ts.map +1 -0
  187. package/dist/utils/validation/isPositiveInteger.js +7 -0
  188. package/dist/utils/validation/isPositiveInteger.js.map +1 -0
  189. package/dist/utils/validation/isUuid.d.ts +2 -0
  190. package/dist/utils/validation/isUuid.d.ts.map +1 -0
  191. package/dist/utils/validation/isUuid.js +7 -0
  192. package/dist/utils/validation/isUuid.js.map +1 -0
  193. package/dist/utils/validation/isUuidArray.d.ts +2 -0
  194. package/dist/utils/validation/isUuidArray.d.ts.map +1 -0
  195. package/dist/utils/validation/isUuidArray.js +7 -0
  196. package/dist/utils/validation/isUuidArray.js.map +1 -0
  197. package/dist/utils/validation/isValidFileName.d.ts +2 -0
  198. package/dist/utils/validation/isValidFileName.d.ts.map +1 -0
  199. package/dist/utils/validation/isValidFileName.js +33 -0
  200. package/dist/utils/validation/isValidFileName.js.map +1 -0
  201. package/dist/utils/validation/isValidUrlLike.d.ts +6 -0
  202. package/dist/utils/validation/isValidUrlLike.d.ts.map +1 -0
  203. package/dist/utils/validation/isValidUrlLike.js +8 -0
  204. package/dist/utils/validation/isValidUrlLike.js.map +1 -0
  205. package/dist/utils/validation/mod.d.ts +21 -0
  206. package/dist/utils/validation/mod.d.ts.map +1 -0
  207. package/dist/utils/validation/mod.js +21 -0
  208. package/dist/utils/validation/mod.js.map +1 -0
  209. package/dist/utils/validation/vEnvBoolean.d.ts +3 -0
  210. package/dist/utils/validation/vEnvBoolean.d.ts.map +1 -0
  211. package/dist/utils/validation/vEnvBoolean.js +5 -0
  212. package/dist/utils/validation/vEnvBoolean.js.map +1 -0
  213. package/dist/utils/validation/vEnvBooleanOrUndefined.d.ts +3 -0
  214. package/dist/utils/validation/vEnvBooleanOrUndefined.d.ts.map +1 -0
  215. package/dist/utils/validation/vEnvBooleanOrUndefined.js +5 -0
  216. package/dist/utils/validation/vEnvBooleanOrUndefined.js.map +1 -0
  217. package/dist/utils/validation/vEnvLogLevel.d.ts +4 -0
  218. package/dist/utils/validation/vEnvLogLevel.d.ts.map +1 -0
  219. package/dist/utils/validation/vEnvLogLevel.js +6 -0
  220. package/dist/utils/validation/vEnvLogLevel.js.map +1 -0
  221. package/dist/utils/validation/vFileName.d.ts +4 -0
  222. package/dist/utils/validation/vFileName.d.ts.map +1 -0
  223. package/dist/utils/validation/vFileName.js +21 -0
  224. package/dist/utils/validation/vFileName.js.map +1 -0
  225. package/dist/utils/validation/vISO8601DateTime.d.ts +5 -0
  226. package/dist/utils/validation/vISO8601DateTime.d.ts.map +1 -0
  227. package/dist/utils/validation/vISO8601DateTime.js +37 -0
  228. package/dist/utils/validation/vISO8601DateTime.js.map +1 -0
  229. package/dist/utils/validation/vLatinInput.d.ts +3 -0
  230. package/dist/utils/validation/vLatinInput.d.ts.map +1 -0
  231. package/dist/utils/validation/vLatinInput.js +3 -0
  232. package/dist/utils/validation/vLatinInput.js.map +1 -0
  233. package/dist/utils/validation/vOmniBoolean.d.ts +3 -0
  234. package/dist/utils/validation/vOmniBoolean.d.ts.map +1 -0
  235. package/dist/utils/validation/vOmniBoolean.js +10 -0
  236. package/dist/utils/validation/vOmniBoolean.js.map +1 -0
  237. package/dist/utils/validation/vQueryBoolean.d.ts +3 -0
  238. package/dist/utils/validation/vQueryBoolean.d.ts.map +1 -0
  239. package/dist/utils/validation/vQueryBoolean.js +7 -0
  240. package/dist/utils/validation/vQueryBoolean.js.map +1 -0
  241. package/dist/utils/validation/vQueryEmailArray.d.ts +9 -0
  242. package/dist/utils/validation/vQueryEmailArray.d.ts.map +1 -0
  243. package/dist/utils/validation/vQueryEmailArray.js +29 -0
  244. package/dist/utils/validation/vQueryEmailArray.js.map +1 -0
  245. package/dist/utils/validation/vQueryNumberArray.d.ts +10 -0
  246. package/dist/utils/validation/vQueryNumberArray.d.ts.map +1 -0
  247. package/dist/utils/validation/vQueryNumberArray.js +32 -0
  248. package/dist/utils/validation/vQueryNumberArray.js.map +1 -0
  249. package/dist/utils/validation/vQueryStringifiedEnumArray.d.ts +3 -0
  250. package/dist/utils/validation/vQueryStringifiedEnumArray.d.ts.map +1 -0
  251. package/dist/utils/validation/vQueryStringifiedEnumArray.js +25 -0
  252. package/dist/utils/validation/vQueryStringifiedEnumArray.js.map +1 -0
  253. package/dist/utils/validation/vQueryUuidArray.d.ts +9 -0
  254. package/dist/utils/validation/vQueryUuidArray.d.ts.map +1 -0
  255. package/dist/utils/validation/vQueryUuidArray.js +27 -0
  256. package/dist/utils/validation/vQueryUuidArray.js.map +1 -0
  257. package/package.json +19 -3
@@ -0,0 +1,447 @@
1
+ /**
2
+ * Original library: hashery (v1.5.1)
3
+ * - Copyright (c) 2025 Jared Wray
4
+ *
5
+ * Modified and integrated in "Inray":
6
+ * - Evgeniy Bushin
7
+ */
8
+ /***/
9
+ import { Hookified } from "./hooks/index.js";
10
+ import { Cache } from "./cache.js";
11
+ import { CRC } from "./providers/crc.js";
12
+ import { WebCrypto } from "./providers/crypto.js";
13
+ import { DJB2 } from "./providers/djb2.js";
14
+ import { FNV1 } from "./providers/fnv1.js";
15
+ import { Murmur } from "./providers/murmur.js";
16
+ import { HashProviders } from "./providers.js";
17
+ export class Hashery extends Hookified {
18
+ _parse = JSON.parse;
19
+ _stringify = JSON.stringify;
20
+ _providers = new HashProviders();
21
+ _defaultAlgorithm = 'SHA-256';
22
+ _defaultAlgorithmSync = 'djb2';
23
+ _cache;
24
+ constructor(options) {
25
+ super(options);
26
+ if (options?.parse) {
27
+ this._parse = options.parse;
28
+ }
29
+ if (options?.stringify) {
30
+ this._stringify = options.stringify;
31
+ }
32
+ if (options?.defaultAlgorithm) {
33
+ this._defaultAlgorithm = options.defaultAlgorithm;
34
+ }
35
+ if (options?.defaultAlgorithmSync) {
36
+ this._defaultAlgorithmSync = options.defaultAlgorithmSync;
37
+ }
38
+ this._cache = new Cache(options?.cache);
39
+ this.loadProviders(options?.providers, {
40
+ includeBase: options?.includeBase ?? true
41
+ });
42
+ }
43
+ /**
44
+ * Gets the parse function used to deserialize stored values.
45
+ * @returns The current parse function (defaults to JSON.parse)
46
+ */
47
+ get parse() {
48
+ return this._parse;
49
+ }
50
+ /**
51
+ * Sets the parse function used to deserialize stored values.
52
+ * @param value - The parse function to use for deserialization
53
+ */
54
+ set parse(value) {
55
+ this._parse = value;
56
+ }
57
+ /**
58
+ * Gets the stringify function used to serialize values for storage.
59
+ * @returns The current stringify function (defaults to JSON.stringify)
60
+ */
61
+ get stringify() {
62
+ return this._stringify;
63
+ }
64
+ /**
65
+ * Sets the stringify function used to serialize values for storage.
66
+ * @param value - The stringify function to use for serialization
67
+ */
68
+ set stringify(value) {
69
+ this._stringify = value;
70
+ }
71
+ /**
72
+ * Gets the HashProviders instance used to manage hash providers.
73
+ * @returns The current HashProviders instance
74
+ */
75
+ get providers() {
76
+ return this._providers;
77
+ }
78
+ /**
79
+ * Sets the HashProviders instance used to manage hash providers.
80
+ * @param value - The HashProviders instance to use
81
+ */
82
+ set providers(value) {
83
+ this._providers = value;
84
+ }
85
+ /**
86
+ * Gets the names of all registered hash algorithm providers.
87
+ * @returns An array of provider names (e.g., ['SHA-256', 'SHA-384', 'SHA-512'])
88
+ */
89
+ get names() {
90
+ return this._providers.names;
91
+ }
92
+ /**
93
+ * Gets the default hash algorithm used when none is specified.
94
+ * @returns The current default algorithm (defaults to 'SHA-256')
95
+ */
96
+ get defaultAlgorithm() {
97
+ return this._defaultAlgorithm;
98
+ }
99
+ /**
100
+ * Sets the default hash algorithm to use when none is specified.
101
+ * @param value - The default algorithm to use (e.g., 'SHA-256', 'SHA-512', 'djb2')
102
+ * @example
103
+ * ```ts
104
+ * const hashery = new Hashery();
105
+ * hashery.defaultAlgorithm = 'SHA-512';
106
+ *
107
+ * // Now toHash will use SHA-512 by default
108
+ * const hash = await hashery.toHash({ data: 'example' });
109
+ * ```
110
+ */
111
+ set defaultAlgorithm(value) {
112
+ this._defaultAlgorithm = value;
113
+ }
114
+ /**
115
+ * Gets the default synchronous hash algorithm used when none is specified.
116
+ * @returns The current default synchronous algorithm (defaults to 'djb2')
117
+ */
118
+ get defaultAlgorithmSync() {
119
+ return this._defaultAlgorithmSync;
120
+ }
121
+ /**
122
+ * Sets the default synchronous hash algorithm to use when none is specified.
123
+ * @param value - The default synchronous algorithm to use (e.g., 'djb2', 'fnv1', 'murmur', 'crc32')
124
+ * @example
125
+ * ```ts
126
+ * const hashery = new Hashery();
127
+ * hashery.defaultAlgorithmSync = 'fnv1';
128
+ *
129
+ * // Now synchronous operations will use fnv1 by default
130
+ * ```
131
+ */
132
+ set defaultAlgorithmSync(value) {
133
+ this._defaultAlgorithmSync = value;
134
+ }
135
+ /**
136
+ * Gets the cache instance used to store computed hash values.
137
+ * @returns The Cache instance
138
+ * @example
139
+ * ```ts
140
+ * const hashery = new Hashery({ cache: { enabled: true } });
141
+ *
142
+ * // Access the cache
143
+ * hashery.cache.enabled; // true
144
+ * hashery.cache.size; // number of cached items
145
+ * hashery.cache.clear(); // clear all cached items
146
+ * ```
147
+ */
148
+ get cache() {
149
+ return this._cache;
150
+ }
151
+ /**
152
+ * Generates a cryptographic hash of the provided data using the Web Crypto API.
153
+ * The data is first stringified using the configured stringify function, then hashed.
154
+ *
155
+ * If an invalid algorithm is provided, a 'warn' event is emitted and the method falls back
156
+ * to the default algorithm. You can listen to these warnings:
157
+ * ```ts
158
+ * hashery.on('warn', (message) => console.log(message));
159
+ * ```
160
+ *
161
+ * @param data - The data to hash (will be stringified before hashing)
162
+ * @param options - Optional configuration object
163
+ * @param options.algorithm - The hash algorithm to use (defaults to 'SHA-256')
164
+ * @param options.maxLength - Optional maximum length for the hash output
165
+ * @returns A Promise that resolves to the hexadecimal string representation of the hash
166
+ *
167
+ * @example
168
+ * ```ts
169
+ * const hashery = new Hashery();
170
+ * const hash = await hashery.toHash({ name: 'John', age: 30 });
171
+ * console.log(hash); // "a1b2c3d4..."
172
+ *
173
+ * // Using a different algorithm
174
+ * const hash512 = await hashery.toHash({ name: 'John' }, { algorithm: 'SHA-512' });
175
+ * ```
176
+ */
177
+ async toHash(data, options) {
178
+ // Before hook - allows modification of input data and algorithm
179
+ const context = {
180
+ data,
181
+ algorithm: options?.algorithm ?? this._defaultAlgorithm,
182
+ maxLength: options?.maxLength
183
+ };
184
+ await this.beforeHook('toHash', context);
185
+ // Stringify the data using the configured stringify function
186
+ const stringified = this._stringify(context.data);
187
+ // Check cache first
188
+ const cacheKey = `${context.algorithm}:${stringified}`;
189
+ if (this._cache.enabled) {
190
+ const cached = this._cache.get(cacheKey);
191
+ if (cached !== undefined) {
192
+ let cachedHash = cached;
193
+ // Apply maxLength if specified
194
+ if (options?.maxLength && cachedHash.length > options.maxLength) {
195
+ cachedHash = cachedHash.substring(0, options.maxLength);
196
+ }
197
+ // After hook - run even on cache hits for consistent behavior
198
+ const result = {
199
+ hash: cachedHash,
200
+ data: context.data,
201
+ algorithm: context.algorithm
202
+ };
203
+ await this.afterHook('toHash', result);
204
+ return result.hash;
205
+ }
206
+ }
207
+ // Convert the string to a Uint8Array
208
+ const encoder = new TextEncoder();
209
+ const dataBuffer = encoder.encode(stringified);
210
+ // Get the provider for the specified algorithm
211
+ let provider = this._providers.get(context.algorithm);
212
+ if (!provider) {
213
+ // Emit warning for invalid algorithm
214
+ this.emit('warn', `Invalid algorithm '${context.algorithm}' not found. Falling back to default algorithm '${this._defaultAlgorithm}'.`);
215
+ provider = new WebCrypto({
216
+ algorithm: this._defaultAlgorithm
217
+ });
218
+ }
219
+ // Use the provider to hash the data
220
+ let hash = await provider.toHash(dataBuffer);
221
+ // Store the full hash in cache before truncation
222
+ if (this._cache.enabled) {
223
+ this._cache.set(cacheKey, hash);
224
+ }
225
+ // if there is a max then change the hash
226
+ if (options?.maxLength && hash.length > options?.maxLength) {
227
+ hash = hash.substring(0, options.maxLength);
228
+ }
229
+ // After hook - allows modification/logging of result
230
+ const result = { hash, data: context.data, algorithm: context.algorithm };
231
+ await this.afterHook('toHash', result);
232
+ return result.hash;
233
+ }
234
+ /**
235
+ * Generates a deterministic number within a specified range based on the hash of the provided data.
236
+ * This method uses the toHash function to create a consistent hash, then maps it to a number
237
+ * between min and max (inclusive).
238
+ *
239
+ * @param data - The data to hash (will be stringified before hashing)
240
+ * @param options - Configuration options (optional, defaults to min: 0, max: 100)
241
+ * @param options.min - The minimum value of the range (inclusive, defaults to 0)
242
+ * @param options.max - The maximum value of the range (inclusive, defaults to 100)
243
+ * @param options.algorithm - The hash algorithm to use (defaults to 'SHA-256')
244
+ * @param options.hashLength - Number of characters from hash to use for conversion (defaults to 16)
245
+ * @returns A Promise that resolves to a number between min and max (inclusive)
246
+ *
247
+ * @example
248
+ * ```ts
249
+ * const hashery = new Hashery();
250
+ * const num = await hashery.toNumber({ user: 'john' }); // Uses default min: 0, max: 100
251
+ * console.log(num); // Always returns the same number for the same input, e.g., 42
252
+ *
253
+ * // Using custom range
254
+ * const num2 = await hashery.toNumber({ user: 'john' }, { min: 1, max: 100 });
255
+ *
256
+ * // Using a different algorithm
257
+ * const num512 = await hashery.toNumber({ user: 'john' }, { min: 0, max: 255, algorithm: 'SHA-512' });
258
+ * ```
259
+ */
260
+ async toNumber(data, options = {}) {
261
+ const { min = 0, max = 100, algorithm = this._defaultAlgorithm, hashLength = 16 } = options;
262
+ if (min > max) {
263
+ throw new Error('min cannot be greater than max');
264
+ }
265
+ // Get the hash as a hex string
266
+ // Take the first hashLength characters of the hash to convert to a number
267
+ // This provides good distribution while avoiding precision issues with JavaScript numbers
268
+ const hash = await this.toHash(data, { algorithm, maxLength: hashLength });
269
+ // Convert hex to a number
270
+ const hashNumber = Number.parseInt(hash, 16);
271
+ // Map the hash number to the desired range
272
+ const range = max - min + 1;
273
+ const mapped = min + (hashNumber % range);
274
+ return mapped;
275
+ }
276
+ /**
277
+ * Generates a hash of the provided data synchronously using a non-cryptographic hash algorithm.
278
+ * The data is first stringified using the configured stringify function, then hashed.
279
+ *
280
+ * Note: This method only works with synchronous hash providers (djb2, fnv1, murmur, crc32).
281
+ * WebCrypto algorithms (SHA-256, SHA-384, SHA-512) are not supported and will throw an error.
282
+ *
283
+ * If an invalid algorithm is provided, a 'warn' event is emitted and the method falls back
284
+ * to the default synchronous algorithm. You can listen to these warnings:
285
+ * ```ts
286
+ * hashery.on('warn', (message) => console.log(message));
287
+ * ```
288
+ *
289
+ * @param data - The data to hash (will be stringified before hashing)
290
+ * @param options - Optional configuration object
291
+ * @param options.algorithm - The hash algorithm to use (defaults to 'djb2')
292
+ * @param options.maxLength - Optional maximum length for the hash output
293
+ * @returns The hexadecimal string representation of the hash
294
+ *
295
+ * @throws {Error} If the specified algorithm does not support synchronous hashing
296
+ * @throws {Error} If the default algorithm is not found
297
+ *
298
+ * @example
299
+ * ```ts
300
+ * const hashery = new Hashery();
301
+ * const hash = hashery.toHashSync({ name: 'John', age: 30 });
302
+ * console.log(hash); // "7c9df5ea..." (djb2 hash)
303
+ *
304
+ * // Using a different algorithm
305
+ * const hashFnv1 = hashery.toHashSync({ name: 'John' }, { algorithm: 'fnv1' });
306
+ * ```
307
+ */
308
+ toHashSync(data, options) {
309
+ // Before hook - allows modification of input data and algorithm (synchronous/blocking)
310
+ const context = {
311
+ data,
312
+ algorithm: options?.algorithm ?? this._defaultAlgorithmSync,
313
+ maxLength: options?.maxLength
314
+ };
315
+ this.hookSync('before:toHashSync', context);
316
+ // Get algorithm from context (may have been modified by hook)
317
+ const algorithm = context.algorithm;
318
+ // Stringify the data using the configured stringify function
319
+ const stringified = this._stringify(context.data);
320
+ // Check cache first
321
+ const cacheKey = `${algorithm}:${stringified}`;
322
+ if (this._cache.enabled) {
323
+ const cached = this._cache.get(cacheKey);
324
+ if (cached !== undefined) {
325
+ let cachedHash = cached;
326
+ // Apply maxLength if specified
327
+ if (options?.maxLength && cachedHash.length > options.maxLength) {
328
+ cachedHash = cachedHash.substring(0, options.maxLength);
329
+ }
330
+ // After hook - run even on cache hits for consistent behavior
331
+ const result = {
332
+ hash: cachedHash,
333
+ data: context.data,
334
+ algorithm
335
+ };
336
+ this.hookSync('after:toHashSync', result);
337
+ return result.hash;
338
+ }
339
+ }
340
+ // Convert the string to a Uint8Array
341
+ const encoder = new TextEncoder();
342
+ const dataBuffer = encoder.encode(stringified);
343
+ // Get the provider for the specified algorithm
344
+ let provider = this._providers.get(algorithm);
345
+ if (!provider) {
346
+ // Emit warning for invalid algorithm
347
+ this.emit('warn', `Invalid algorithm '${algorithm}' not found. Falling back to default algorithm '${this._defaultAlgorithmSync}'.`);
348
+ // Fallback to default sync algorithm
349
+ provider = this._providers.get(this._defaultAlgorithmSync);
350
+ // If default algorithm is also not found, throw error
351
+ if (!provider) {
352
+ throw new Error(`Hash provider '${this._defaultAlgorithmSync}' (default) not found`);
353
+ }
354
+ }
355
+ // Check if provider supports synchronous hashing
356
+ if (!provider.toHashSync) {
357
+ throw new Error(`Hash provider '${algorithm}' does not support synchronous hashing. Use toHash() instead or choose a different algorithm (djb2, fnv1, murmur, crc32).`);
358
+ }
359
+ // Use the provider to hash the data synchronously
360
+ let hash = provider.toHashSync(dataBuffer);
361
+ // Store the full hash in cache before truncation
362
+ if (this._cache.enabled) {
363
+ this._cache.set(cacheKey, hash);
364
+ }
365
+ // if there is a max then change the hash
366
+ if (options?.maxLength && hash.length > options?.maxLength) {
367
+ hash = hash.substring(0, options.maxLength);
368
+ }
369
+ // After hook - allows modification/logging of result (synchronous/blocking)
370
+ const result = { hash, data: context.data, algorithm: context.algorithm };
371
+ this.hookSync('after:toHashSync', result);
372
+ return result.hash;
373
+ }
374
+ /**
375
+ * Generates a deterministic number within a specified range based on the hash of the provided data synchronously.
376
+ * This method uses the toHashSync function to create a consistent hash, then maps it to a number
377
+ * between min and max (inclusive).
378
+ *
379
+ * Note: This method only works with synchronous hash providers (djb2, fnv1, murmur, crc32).
380
+ *
381
+ * @param data - The data to hash (will be stringified before hashing)
382
+ * @param options - Configuration options (optional, defaults to min: 0, max: 100)
383
+ * @param options.min - The minimum value of the range (inclusive, defaults to 0)
384
+ * @param options.max - The maximum value of the range (inclusive, defaults to 100)
385
+ * @param options.algorithm - The hash algorithm to use (defaults to 'djb2')
386
+ * @param options.hashLength - Number of characters from hash to use for conversion (defaults to 16)
387
+ * @returns A number between min and max (inclusive)
388
+ *
389
+ * @throws {Error} If the specified algorithm does not support synchronous hashing
390
+ * @throws {Error} If min is greater than max
391
+ *
392
+ * @example
393
+ * ```ts
394
+ * const hashery = new Hashery();
395
+ * const num = hashery.toNumberSync({ user: 'john' }); // Uses default min: 0, max: 100
396
+ * console.log(num); // Always returns the same number for the same input, e.g., 42
397
+ *
398
+ * // Using custom range
399
+ * const num2 = hashery.toNumberSync({ user: 'john' }, { min: 1, max: 100 });
400
+ *
401
+ * // Using a different algorithm
402
+ * const numFnv1 = hashery.toNumberSync({ user: 'john' }, { min: 0, max: 255, algorithm: 'fnv1' });
403
+ * ```
404
+ */
405
+ toNumberSync(data, options = {}) {
406
+ const { min = 0, max = 100, algorithm = this._defaultAlgorithmSync, hashLength = 16 } = options;
407
+ if (min > max) {
408
+ throw new Error('min cannot be greater than max');
409
+ }
410
+ // Get the hash as a hex string
411
+ // Take the first hashLength characters of the hash to convert to a number
412
+ // This provides good distribution while avoiding precision issues with JavaScript numbers
413
+ const hash = this.toHashSync(data, { algorithm, maxLength: hashLength });
414
+ // Convert hex to a number
415
+ const hashNumber = Number.parseInt(hash, 16);
416
+ // Map the hash number to the desired range
417
+ const range = max - min + 1;
418
+ const mapped = min + (hashNumber % range);
419
+ return mapped;
420
+ }
421
+ loadProviders(providers, options = { includeBase: true }) {
422
+ if (providers) {
423
+ for (const provider of providers) {
424
+ this._providers.add(provider);
425
+ }
426
+ }
427
+ // load all the providers
428
+ if (options.includeBase) {
429
+ this.providers.add(new WebCrypto({ algorithm: 'SHA-256' }));
430
+ this.providers.add(new WebCrypto({ algorithm: 'SHA-384' }));
431
+ this.providers.add(new WebCrypto({ algorithm: 'SHA-512' }));
432
+ this.providers.add(new CRC());
433
+ this.providers.add(new DJB2());
434
+ this.providers.add(new FNV1());
435
+ this.providers.add(new Murmur());
436
+ }
437
+ }
438
+ }
439
+ // Classes
440
+ export { Cache } from './cache.js';
441
+ export { CRC } from './providers/crc.js';
442
+ export { WebCrypto } from './providers/crypto.js';
443
+ export { DJB2 } from './providers/djb2.js';
444
+ export { FNV1 } from './providers/fnv1.js';
445
+ export { Murmur } from './providers/murmur.js';
446
+ export { HashProviders } from './providers.js';
447
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/caching/src/hashing/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAEL,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,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,IAAI,IAAI,EAAE,CAAC,CAAC;YAC/B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AAID,UAAU;AACV,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Original library: hashery (v1.5.1)
3
+ * - Copyright (c) 2025 Jared Wray
4
+ *
5
+ * Modified and integrated in "Inray":
6
+ * - Evgeniy Bushin
7
+ */
8
+ /***/
9
+ import type { HashProvider } from '../types.ts';
10
+ export declare class CRC implements HashProvider {
11
+ get name(): string;
12
+ toHashSync(data: BufferSource): string;
13
+ toHash(data: BufferSource): Promise<string>;
14
+ }
15
+ //# sourceMappingURL=crc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crc.d.ts","sourceRoot":"","sources":["../../../../../src/caching/src/hashing/providers/crc.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAEL,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,qBAAa,GAAI,YAAW,YAAY;IACtC,IAAW,IAAI,IAAI,MAAM,CAExB;IAEM,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM;IAmChC,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;CAGzD"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Original library: hashery (v1.5.1)
3
+ * - Copyright (c) 2025 Jared Wray
4
+ *
5
+ * Modified and integrated in "Inray":
6
+ * - Evgeniy Bushin
7
+ */
8
+ /***/
9
+ export class CRC {
10
+ get name() {
11
+ return 'crc32';
12
+ }
13
+ toHashSync(data) {
14
+ // Convert BufferSource to Uint8Array
15
+ let bytes;
16
+ if (data instanceof Uint8Array) {
17
+ bytes = data;
18
+ }
19
+ else if (data instanceof ArrayBuffer) {
20
+ bytes = new Uint8Array(data);
21
+ }
22
+ else if (data instanceof DataView) {
23
+ bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
24
+ }
25
+ else {
26
+ const view = data;
27
+ bytes = new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
28
+ }
29
+ // CRC-32 algorithm (IEEE 802.3 polynomial)
30
+ // This is the same algorithm used by PHP's crc32() function
31
+ const CRC32_POLYNOMIAL = 0xedb88320;
32
+ let crc = 0xffffffff;
33
+ for (let i = 0; i < bytes.length; i++) {
34
+ crc = crc ^ bytes[i];
35
+ for (let j = 0; j < 8; j++) {
36
+ crc = (crc >>> 1) ^ (CRC32_POLYNOMIAL & -(crc & 1));
37
+ }
38
+ }
39
+ // Finalize CRC
40
+ crc = (crc ^ 0xffffffff) >>> 0;
41
+ // Convert to hexadecimal string (8 characters, zero-padded)
42
+ const hashHex = crc.toString(16).padStart(8, '0');
43
+ return hashHex;
44
+ }
45
+ async toHash(data) {
46
+ return this.toHashSync(data);
47
+ }
48
+ }
49
+ //# sourceMappingURL=crc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crc.js","sourceRoot":"","sources":["../../../../../src/caching/src/hashing/providers/crc.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAIL,MAAM,OAAO,GAAG;IACd,IAAW,IAAI;QACb,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,UAAU,CAAC,IAAkB;QAClC,qCAAqC;QACrC,IAAI,KAAiB,CAAC;QAEtB,IAAI,IAAI,YAAY,U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,OAAO,CAAC;IACjB,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,IAAkB;QACpC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Original library: hashery (v1.5.1)
3
+ * - Copyright (c) 2025 Jared Wray
4
+ *
5
+ * Modified and integrated in "Inray":
6
+ * - Evgeniy Bushin
7
+ */
8
+ /***/
9
+ import type { WebCryptoHashAlgorithm, HashProvider } from '../types.ts';
10
+ export type WebCryptoOptions = {
11
+ algorithm?: WebCryptoHashAlgorithm;
12
+ };
13
+ export declare class WebCrypto implements HashProvider {
14
+ private _algorithm;
15
+ constructor(options?: WebCryptoOptions);
16
+ get name(): string;
17
+ toHash(data: BufferSource): Promise<string>;
18
+ }
19
+ //# sourceMappingURL=crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../../../src/caching/src/hashing/providers/crypto.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAEL,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF,qBAAa,SAAU,YAAW,YAAY;IAC5C,OAAO,CAAC,UAAU,CAAqC;gBAC3C,OAAO,CAAC,EAAE,gBAAgB;IAMtC,IAAW,IAAI,IAAI,MAAM,CAExB;IAEY,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;CAUzD"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Original library: hashery (v1.5.1)
3
+ * - Copyright (c) 2025 Jared Wray
4
+ *
5
+ * Modified and integrated in "Inray":
6
+ * - Evgeniy Bushin
7
+ */
8
+ /***/
9
+ export class WebCrypto {
10
+ _algorithm = 'SHA-256';
11
+ constructor(options) {
12
+ if (options?.algorithm) {
13
+ this._algorithm = options?.algorithm;
14
+ }
15
+ }
16
+ get name() {
17
+ return this._algorithm;
18
+ }
19
+ async toHash(data) {
20
+ // Hash the data using Web Crypto API
21
+ const hashBuffer = await crypto.subtle.digest(this._algorithm, data);
22
+ // Convert the hash to a hexadecimal string
23
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
24
+ const hashHex = hashArray.map((byte) => byte.toString(16).padStart(2, '0')).join('');
25
+ return hashHex;
26
+ }
27
+ }
28
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../../../src/caching/src/hashing/providers/crypto.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK;AAQL,MAAM,OAAO,SAAS;IACZ,UAAU,GAA2B,SAAS,CAAC;IACvD,YAAY,OAA0B;QACpC,IAAI,OAAO,EAAE,SAAS,EAAE,CAAC;YACvB,IAAI,CAAC,UAAU,GAAG,OAAO,EAAE,SAAS,CAAC;QACvC,CAAC;IACH,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,IAAkB;QACpC,qCAAqC;QACrC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAErE,2CAA2C;QAC3C,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAErF,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,60 @@
1
+ import type { HashProvider } from '../types.ts';
2
+ /**
3
+ * DJB2 hash algorithm implementation.
4
+ *
5
+ * DJB2 is a non-cryptographic hash function created by Daniel J. Bernstein.
6
+ * It produces a 32-bit hash value, making it suitable for hash tables and checksums,
7
+ * but NOT for cryptographic purposes.
8
+ *
9
+ * Algorithm: hash = hash * 33 + c (where c is each byte)
10
+ * Initial value: 5381
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { Hashery } from 'hashery';
15
+ * import { DJB2 } from 'hashery/providers/djb2';
16
+ *
17
+ * const hashery = new Hashery();
18
+ * hashery.providers.add(new DJB2());
19
+ *
20
+ * const hash = await hashery.toHash({ data: 'hello' }, 'djb2');
21
+ * console.log(hash); // "7c9df5ea"
22
+ * ```
23
+ */
24
+ export declare class DJB2 implements HashProvider {
25
+ /**
26
+ * The name identifier for this hash provider.
27
+ */
28
+ get name(): string;
29
+ /**
30
+ * Computes the DJB2 hash of the provided data synchronously.
31
+ *
32
+ * @param data - The data to hash (Uint8Array, ArrayBuffer, or DataView)
33
+ * @returns An 8-character lowercase hexadecimal string
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * const djb2 = new DJB2();
38
+ * const data = new TextEncoder().encode('hello');
39
+ * const hash = djb2.toHashSync(data);
40
+ * console.log(hash); // "7c9df5ea"
41
+ * ```
42
+ */
43
+ toHashSync(data: BufferSource): string;
44
+ /**
45
+ * Computes the DJB2 hash of the provided data.
46
+ *
47
+ * @param data - The data to hash (Uint8Array, ArrayBuffer, or DataView)
48
+ * @returns A Promise resolving to an 8-character lowercase hexadecimal string
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * const djb2 = new DJB2();
53
+ * const data = new TextEncoder().encode('hello');
54
+ * const hash = await djb2.toHash(data);
55
+ * console.log(hash); // "7c9df5ea"
56
+ * ```
57
+ */
58
+ toHash(data: BufferSource): Promise<string>;
59
+ }
60
+ //# sourceMappingURL=djb2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"djb2.d.ts","sourceRoot":"","sources":["../../../../../src/caching/src/hashing/providers/djb2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,IAAK,YAAW,YAAY;IACvC;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;;;;;;;;;;;OAaG;IACI,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM;IAiC7C;;;;;;;;;;;;;OAaG;IACU,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;CAGzD"}