@kikiutils/shared 18.0.1 → 18.2.0
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.
- package/dist/buffer.d.ts +19 -21
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +18 -19
- package/dist/buffer.js.map +1 -1
- package/dist/classes/enhanced-date.d.ts +457 -0
- package/dist/classes/enhanced-date.d.ts.map +1 -0
- package/dist/classes/enhanced-date.js +635 -0
- package/dist/classes/enhanced-date.js.map +1 -0
- package/dist/classes/path.d.ts +211 -48
- package/dist/classes/path.d.ts.map +1 -1
- package/dist/classes/path.js +188 -54
- package/dist/classes/path.js.map +1 -1
- package/dist/classes/precision-number.d.ts +44 -39
- package/dist/classes/precision-number.d.ts.map +1 -1
- package/dist/classes/precision-number.js +51 -45
- package/dist/classes/precision-number.js.map +1 -1
- package/dist/classes/ssh-client.d.ts +3 -4
- package/dist/classes/ssh-client.d.ts.map +1 -1
- package/dist/classes/ssh-client.js +2 -2
- package/dist/classes/ssh-client.js.map +1 -1
- package/dist/clipboard.d.ts +25 -26
- package/dist/clipboard.d.ts.map +1 -1
- package/dist/clipboard.js +23 -23
- package/dist/clipboard.js.map +1 -1
- package/dist/consola.d.ts +12 -15
- package/dist/consola.d.ts.map +1 -1
- package/dist/consola.js +10 -12
- package/dist/consola.js.map +1 -1
- package/dist/crypto-hash.d.ts +65 -56
- package/dist/crypto-hash.d.ts.map +1 -1
- package/dist/crypto-hash.js +55 -45
- package/dist/crypto-hash.js.map +1 -1
- package/dist/datetime.d.ts +41 -53
- package/dist/datetime.d.ts.map +1 -1
- package/dist/datetime.js +53 -66
- package/dist/datetime.js.map +1 -1
- package/dist/element-plus.d.ts +13 -14
- package/dist/element-plus.d.ts.map +1 -1
- package/dist/element-plus.js +11 -11
- package/dist/element-plus.js.map +1 -1
- package/dist/enum.d.ts +39 -36
- package/dist/enum.d.ts.map +1 -1
- package/dist/enum.js +36 -32
- package/dist/enum.js.map +1 -1
- package/dist/env.d.ts +22 -15
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +20 -12
- package/dist/env.js.map +1 -1
- package/dist/event-awaiter.d.ts +47 -52
- package/dist/event-awaiter.d.ts.map +1 -1
- package/dist/event-awaiter.js +46 -50
- package/dist/event-awaiter.js.map +1 -1
- package/dist/general.d.ts +22 -17
- package/dist/general.d.ts.map +1 -1
- package/dist/general.js.map +1 -1
- package/dist/hash.d.ts +24 -21
- package/dist/hash.d.ts.map +1 -1
- package/dist/hash.js +20 -16
- package/dist/hash.js.map +1 -1
- package/dist/math.d.ts +20 -19
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +14 -12
- package/dist/math.js.map +1 -1
- package/dist/number.d.ts +10 -9
- package/dist/number.d.ts.map +1 -1
- package/dist/number.js +9 -7
- package/dist/number.js.map +1 -1
- package/dist/object.d.ts +22 -10
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +21 -8
- package/dist/object.js.map +1 -1
- package/dist/pino.d.ts +13 -15
- package/dist/pino.d.ts.map +1 -1
- package/dist/pino.js +10 -15
- package/dist/pino.js.map +1 -1
- package/dist/random.d.ts +17 -15
- package/dist/random.d.ts.map +1 -1
- package/dist/random.js +16 -13
- package/dist/random.js.map +1 -1
- package/dist/redis/script-runner.d.ts +57 -0
- package/dist/redis/script-runner.d.ts.map +1 -0
- package/dist/redis/script-runner.js +46 -0
- package/dist/redis/script-runner.js.map +1 -0
- package/dist/storages/lru/keyed-store.d.ts +18 -14
- package/dist/storages/lru/keyed-store.d.ts.map +1 -1
- package/dist/storages/lru/keyed-store.js +17 -12
- package/dist/storages/lru/keyed-store.js.map +1 -1
- package/dist/storages/redis/keyed-store.d.ts +11 -21
- package/dist/storages/redis/keyed-store.d.ts.map +1 -1
- package/dist/storages/redis/keyed-store.js +10 -19
- package/dist/storages/redis/keyed-store.js.map +1 -1
- package/dist/storages/redis/msgpack.d.ts +33 -13
- package/dist/storages/redis/msgpack.d.ts.map +1 -1
- package/dist/storages/redis/msgpack.js +32 -11
- package/dist/storages/redis/msgpack.js.map +1 -1
- package/dist/storages/redis/types.d.ts +34 -17
- package/dist/storages/redis/types.d.ts.map +1 -1
- package/dist/string.d.ts +12 -11
- package/dist/string.d.ts.map +1 -1
- package/dist/string.js +20 -15
- package/dist/string.js.map +1 -1
- package/dist/time.d.ts +26 -21
- package/dist/time.d.ts.map +1 -1
- package/dist/time.js +24 -18
- package/dist/time.js.map +1 -1
- package/dist/types/filtered-key-path.d.ts +4 -15
- package/dist/types/filtered-key-path.d.ts.map +1 -1
- package/dist/types/index.d.ts +10 -10
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/vue.d.ts +7 -7
- package/dist/types/vue.d.ts.map +1 -1
- package/dist/url.d.ts +15 -14
- package/dist/url.d.ts.map +1 -1
- package/dist/url.js +12 -10
- package/dist/url.js.map +1 -1
- package/dist/vue.d.ts +19 -21
- package/dist/vue.d.ts.map +1 -1
- package/dist/vue.js +15 -16
- package/dist/vue.js.map +1 -1
- package/dist/web.d.ts +14 -11
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +12 -8
- package/dist/web.js.map +1 -1
- package/package.json +21 -21
- package/src/buffer.ts +18 -19
- package/src/classes/enhanced-date.ts +715 -0
- package/src/classes/path.ts +248 -96
- package/src/classes/precision-number.ts +61 -53
- package/src/classes/ssh-client.ts +8 -5
- package/src/clipboard.ts +23 -23
- package/src/consola.ts +10 -12
- package/src/crypto-hash.ts +55 -45
- package/src/datetime.ts +65 -85
- package/src/element-plus.ts +11 -11
- package/src/enum.ts +36 -32
- package/src/env.ts +20 -12
- package/src/event-awaiter.ts +49 -50
- package/src/general.ts +20 -14
- package/src/hash.ts +20 -16
- package/src/math.ts +18 -16
- package/src/number.ts +9 -7
- package/src/object.ts +21 -8
- package/src/pino.ts +11 -15
- package/src/random.ts +16 -13
- package/src/redis/script-runner.ts +107 -0
- package/src/storages/lru/keyed-store.ts +17 -12
- package/src/storages/redis/keyed-store.ts +10 -19
- package/src/storages/redis/msgpack.ts +32 -11
- package/src/storages/redis/types.ts +32 -14
- package/src/string.ts +10 -8
- package/src/time.ts +24 -18
- package/src/types/filtered-key-path.ts +9 -14
- package/src/types/vue.ts +6 -5
- package/src/url.ts +12 -10
- package/src/vue.ts +15 -16
- package/src/web.ts +12 -8
package/dist/consola.d.ts
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
//#region src/consola.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* A consola logger
|
|
3
|
+
* A consola logger with environment-controlled verbosity.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* To manually change the level, assign the desired level to `logger.level`.
|
|
10
|
-
*
|
|
11
|
-
* See available levels [here](https://github.com/unjs/consola?tab=readme-ov-file#log-level).
|
|
5
|
+
* @remarks
|
|
6
|
+
* `CONSOLA_LOGGER_LEVEL` sets the log level when defined at module initialization;
|
|
7
|
+
* otherwise, `NODE_ENV=production` selects `0`, and other environments retain the logger's default level.
|
|
8
|
+
* Assign `logger.level` to change verbosity after initialization.
|
|
12
9
|
*
|
|
13
10
|
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import { logger } from '@kikiutils/shared/consola';
|
|
16
11
|
*
|
|
17
|
-
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { logger } from '@kikiutils/shared/consola';
|
|
18
14
|
*
|
|
19
|
-
* // Manually change the level
|
|
20
15
|
* logger.level = 3;
|
|
16
|
+
* logger.info('Application started');
|
|
21
17
|
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://github.com/unjs/consola#log-level | Consola log levels}
|
|
22
20
|
*/
|
|
23
|
-
declare const consolaLogger: import("consola").ConsolaInstance;
|
|
24
|
-
declare const logger: import("consola").ConsolaInstance;
|
|
21
|
+
export declare const consolaLogger: import("consola").ConsolaInstance;
|
|
22
|
+
export declare const logger: import("consola").ConsolaInstance;
|
|
25
23
|
//#endregion
|
|
26
|
-
export { consolaLogger, logger };
|
|
27
24
|
//# sourceMappingURL=consola.d.ts.map
|
package/dist/consola.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consola.d.ts","names":[],"sources":["../src/consola.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"consola.d.ts","names":[],"sources":["../src/consola.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;qBAqBa,iCAAa;qBACb,0BAAM"}
|
package/dist/consola.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { createConsola } from "consola";
|
|
2
2
|
//#region src/consola.ts
|
|
3
3
|
/**
|
|
4
|
-
* A consola logger
|
|
4
|
+
* A consola logger with environment-controlled verbosity.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* To manually change the level, assign the desired level to `logger.level`.
|
|
11
|
-
*
|
|
12
|
-
* See available levels [here](https://github.com/unjs/consola?tab=readme-ov-file#log-level).
|
|
6
|
+
* @remarks
|
|
7
|
+
* `CONSOLA_LOGGER_LEVEL` sets the log level when defined at module initialization;
|
|
8
|
+
* otherwise, `NODE_ENV=production` selects `0`, and other environments retain the logger's default level.
|
|
9
|
+
* Assign `logger.level` to change verbosity after initialization.
|
|
13
10
|
*
|
|
14
11
|
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* import { logger } from '@kikiutils/shared/consola';
|
|
17
12
|
*
|
|
18
|
-
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { logger } from '@kikiutils/shared/consola';
|
|
19
15
|
*
|
|
20
|
-
* // Manually change the level
|
|
21
16
|
* logger.level = 3;
|
|
17
|
+
* logger.info('Application started');
|
|
22
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* @see {@link https://github.com/unjs/consola#log-level | Consola log levels}
|
|
23
21
|
*/
|
|
24
22
|
const consolaLogger = createConsola();
|
|
25
23
|
const logger = consolaLogger;
|
package/dist/consola.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consola.js","names":[],"sources":["../src/consola.ts"],"sourcesContent":["import { createConsola } from 'consola';\n\n/**\n * A consola logger
|
|
1
|
+
{"version":3,"file":"consola.js","names":[],"sources":["../src/consola.ts"],"sourcesContent":["import { createConsola } from 'consola';\n\n/**\n * A consola logger with environment-controlled verbosity.\n *\n * @remarks\n * `CONSOLA_LOGGER_LEVEL` sets the log level when defined at module initialization;\n * otherwise, `NODE_ENV=production` selects `0`, and other environments retain the logger's default level.\n * Assign `logger.level` to change verbosity after initialization.\n *\n * @example\n *\n * ```ts\n * import { logger } from '@kikiutils/shared/consola';\n *\n * logger.level = 3;\n * logger.info('Application started');\n * ```\n *\n * @see {@link https://github.com/unjs/consola#log-level | Consola log levels}\n */\nexport const consolaLogger = createConsola();\nexport const logger = consolaLogger;\nif (process.env.CONSOLA_LOGGER_LEVEL !== undefined) consolaLogger.level = +process.env.CONSOLA_LOGGER_LEVEL;\nelse consolaLogger.level = process.env.NODE_ENV === 'production' ? 0 : consolaLogger.level;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,gBAAgB,cAAc;AAC3C,MAAa,SAAS;AACtB,IAAI,QAAQ,IAAI,yBAAyB,KAAA,GAAW,cAAc,QAAQ,CAAC,QAAQ,IAAI;KAClF,cAAc,QAAQ,QAAQ,IAAI,aAAa,eAAe,IAAI,cAAc"}
|
package/dist/crypto-hash.d.ts
CHANGED
|
@@ -3,158 +3,167 @@ import { BinaryLike } from "node:crypto";
|
|
|
3
3
|
/**
|
|
4
4
|
* Computes the MD5 hash of the given data.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
6
|
+
* @param data - The input data to hash.
|
|
7
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
8
8
|
*
|
|
9
|
-
* @returns
|
|
9
|
+
* @returns The hash digest in the specified encoding.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
|
-
*
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
13
14
|
* import { cryptoMd5 } from '@kikiutils/shared/crypto-hash';
|
|
14
15
|
*
|
|
15
|
-
* console.log(cryptoMd5('test')); // 098f6bcd4621d373cade4e832627b4f6
|
|
16
|
+
* console.log(cryptoMd5('test')); // => 098f6bcd4621d373cade4e832627b4f6
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
|
-
declare function cryptoMd5(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
19
|
+
export declare function cryptoMd5(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
19
20
|
/**
|
|
20
21
|
* Computes the MD5 hash of the given data and returns the raw buffer.
|
|
21
22
|
*
|
|
22
|
-
* @param
|
|
23
|
+
* @param data - The input data to hash.
|
|
23
24
|
*
|
|
24
|
-
* @returns
|
|
25
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
25
26
|
*
|
|
26
27
|
* @example
|
|
27
|
-
*
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
28
30
|
* import { cryptoMd5ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
29
31
|
*
|
|
30
|
-
* console.log(cryptoMd5ToBuffer('test')); // <Buffer
|
|
32
|
+
* console.log(cryptoMd5ToBuffer('test')); // => <Buffer 09 8f 6b cd ...>
|
|
31
33
|
* ```
|
|
32
34
|
*/
|
|
33
|
-
declare function cryptoMd5ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
35
|
+
export declare function cryptoMd5ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
34
36
|
/**
|
|
35
37
|
* Computes the SHA-3 hash of the given data using the 224-bit digest.
|
|
36
38
|
*
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
+
* @param data - The input data to hash.
|
|
40
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
39
41
|
*
|
|
40
|
-
* @returns
|
|
42
|
+
* @returns The hash digest in the specified encoding.
|
|
41
43
|
*
|
|
42
44
|
* @example
|
|
43
|
-
*
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
44
47
|
* import { cryptoSha3224 } from '@kikiutils/shared/crypto-hash';
|
|
45
48
|
*
|
|
46
|
-
* console.log(cryptoSha3224('test')); // 3797bf0afbbfca4a7bbba7602a2b552746876517a7f9b7ce2db0ae7b
|
|
49
|
+
* console.log(cryptoSha3224('test')); // => 3797bf0afbbfca4a7bbba7602a2b552746876517a7f9b7ce2db0ae7b
|
|
47
50
|
* ```
|
|
48
51
|
*/
|
|
49
|
-
declare function cryptoSha3224(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
52
|
+
export declare function cryptoSha3224(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
50
53
|
/**
|
|
51
54
|
* Computes the SHA-3 hash of the given data using the 224-bit digest and returns the raw buffer.
|
|
52
55
|
*
|
|
53
|
-
* @param
|
|
56
|
+
* @param data - The input data to hash.
|
|
54
57
|
*
|
|
55
|
-
* @returns
|
|
58
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
56
59
|
*
|
|
57
60
|
* @example
|
|
58
|
-
*
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
59
63
|
* import { cryptoSha3224ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
60
64
|
*
|
|
61
|
-
* console.log(cryptoSha3224ToBuffer('test')); // <Buffer 37 97 bf 0a ...>
|
|
65
|
+
* console.log(cryptoSha3224ToBuffer('test')); // => <Buffer 37 97 bf 0a ...>
|
|
62
66
|
* ```
|
|
63
67
|
*/
|
|
64
|
-
declare function cryptoSha3224ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
68
|
+
export declare function cryptoSha3224ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
65
69
|
/**
|
|
66
70
|
* Computes the SHA-3 hash of the given data using the 256-bit digest.
|
|
67
71
|
*
|
|
68
|
-
* @param
|
|
69
|
-
* @param
|
|
72
|
+
* @param data - The input data to hash.
|
|
73
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
70
74
|
*
|
|
71
|
-
* @returns
|
|
75
|
+
* @returns The hash digest in the specified encoding.
|
|
72
76
|
*
|
|
73
77
|
* @example
|
|
74
|
-
*
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
75
80
|
* import { cryptoSha3256 } from '@kikiutils/shared/crypto-hash';
|
|
76
81
|
*
|
|
77
|
-
* console.log(cryptoSha3256('test')); // 36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80
|
|
82
|
+
* console.log(cryptoSha3256('test')); // => 36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80
|
|
78
83
|
* ```
|
|
79
84
|
*/
|
|
80
|
-
declare function cryptoSha3256(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
85
|
+
export declare function cryptoSha3256(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
81
86
|
/**
|
|
82
87
|
* Computes the SHA-3 hash of the given data using the 256-bit digest and returns the raw buffer.
|
|
83
88
|
*
|
|
84
|
-
* @param
|
|
89
|
+
* @param data - The input data to hash.
|
|
85
90
|
*
|
|
86
|
-
* @returns
|
|
91
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
87
92
|
*
|
|
88
93
|
* @example
|
|
89
|
-
*
|
|
94
|
+
*
|
|
95
|
+
* ```ts
|
|
90
96
|
* import { cryptoSha3256ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
91
97
|
*
|
|
92
|
-
* console.log(cryptoSha3256ToBuffer('test')); // <Buffer 36 f0 28 ...>
|
|
98
|
+
* console.log(cryptoSha3256ToBuffer('test')); // => <Buffer 36 f0 28 ...>
|
|
93
99
|
* ```
|
|
94
100
|
*/
|
|
95
|
-
declare function cryptoSha3256ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
101
|
+
export declare function cryptoSha3256ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
96
102
|
/**
|
|
97
103
|
* Computes the SHA-3 hash of the given data using the 384-bit digest.
|
|
98
104
|
*
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
105
|
+
* @param data - The input data to hash.
|
|
106
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
101
107
|
*
|
|
102
|
-
* @returns
|
|
108
|
+
* @returns The hash digest in the specified encoding.
|
|
103
109
|
*
|
|
104
110
|
* @example
|
|
105
|
-
*
|
|
111
|
+
*
|
|
112
|
+
* ```ts
|
|
106
113
|
* import { cryptoSha3384 } from '@kikiutils/shared/crypto-hash';
|
|
107
114
|
*
|
|
108
|
-
* console.log(cryptoSha3384('test')); // e516dabb23b6e30026863543282780a3ae0dccf05551cf0295178d7f...
|
|
115
|
+
* console.log(cryptoSha3384('test')); // => e516dabb23b6e30026863543282780a3ae0dccf05551cf0295178d7f...
|
|
109
116
|
* ```
|
|
110
117
|
*/
|
|
111
|
-
declare function cryptoSha3384(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
118
|
+
export declare function cryptoSha3384(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
112
119
|
/**
|
|
113
120
|
* Computes the SHA-3 hash of the given data using the 384-bit digest and returns the raw buffer.
|
|
114
121
|
*
|
|
115
|
-
* @param
|
|
122
|
+
* @param data - The input data to hash.
|
|
116
123
|
*
|
|
117
|
-
* @returns
|
|
124
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
118
125
|
*
|
|
119
126
|
* @example
|
|
120
|
-
*
|
|
127
|
+
*
|
|
128
|
+
* ```ts
|
|
121
129
|
* import { cryptoSha3384ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
122
130
|
*
|
|
123
|
-
* console.log(cryptoSha3384ToBuffer('test')); // <Buffer e5 16 da bb ...>
|
|
131
|
+
* console.log(cryptoSha3384ToBuffer('test')); // => <Buffer e5 16 da bb ...>
|
|
124
132
|
* ```
|
|
125
133
|
*/
|
|
126
|
-
declare function cryptoSha3384ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
134
|
+
export declare function cryptoSha3384ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
127
135
|
/**
|
|
128
136
|
* Computes the SHA-3 hash of the given data using the 512-bit digest.
|
|
129
137
|
*
|
|
130
|
-
* @param
|
|
131
|
-
* @param
|
|
138
|
+
* @param data - The input data to hash.
|
|
139
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
132
140
|
*
|
|
133
|
-
* @returns
|
|
141
|
+
* @returns The hash digest in the specified encoding.
|
|
134
142
|
*
|
|
135
143
|
* @example
|
|
136
|
-
*
|
|
144
|
+
*
|
|
145
|
+
* ```ts
|
|
137
146
|
* import { cryptoSha3512 } from '@kikiutils/shared/crypto-hash';
|
|
138
147
|
*
|
|
139
|
-
* console.log(cryptoSha3512('test')); // 9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7...
|
|
148
|
+
* console.log(cryptoSha3512('test')); // => 9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7...
|
|
140
149
|
* ```
|
|
141
150
|
*/
|
|
142
|
-
declare function cryptoSha3512(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
151
|
+
export declare function cryptoSha3512(data: BinaryLike, outputEncoding?: BufferEncoding): string;
|
|
143
152
|
/**
|
|
144
153
|
* Computes the SHA-3 hash of the given data using the 512-bit digest and returns the raw buffer.
|
|
145
154
|
*
|
|
146
|
-
* @param
|
|
155
|
+
* @param data - The input data to hash.
|
|
147
156
|
*
|
|
148
|
-
* @returns
|
|
157
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
149
158
|
*
|
|
150
159
|
* @example
|
|
151
|
-
*
|
|
160
|
+
*
|
|
161
|
+
* ```ts
|
|
152
162
|
* import { cryptoSha3512ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
153
163
|
*
|
|
154
|
-
* console.log(cryptoSha3512ToBuffer('test')); // <Buffer 9e ce 08 6e ...>
|
|
164
|
+
* console.log(cryptoSha3512ToBuffer('test')); // => <Buffer 9e ce 08 6e ...>
|
|
155
165
|
* ```
|
|
156
166
|
*/
|
|
157
|
-
declare function cryptoSha3512ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
167
|
+
export declare function cryptoSha3512ToBuffer(data: BinaryLike): NonSharedBuffer;
|
|
158
168
|
//#endregion
|
|
159
|
-
export { cryptoMd5, cryptoMd5ToBuffer, cryptoSha3224, cryptoSha3224ToBuffer, cryptoSha3256, cryptoSha3256ToBuffer, cryptoSha3384, cryptoSha3384ToBuffer, cryptoSha3512, cryptoSha3512ToBuffer };
|
|
160
169
|
//# sourceMappingURL=crypto-hash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-hash.d.ts","names":[],"sources":["../src/crypto-hash.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"crypto-hash.d.ts","names":[],"sources":["../src/crypto-hash.ts"],"mappings":";;;;;;;;;;;;;;;;;;wBAoBgB,UAAU,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmB5C,kBAAkB,MAAM,aAAU;;;;;;;;;;;;;;;;;wBAoBlC,cAAc,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmBhD,sBAAsB,MAAM,aAAU;;;;;;;;;;;;;;;;;wBAoBtC,cAAc,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmBhD,sBAAsB,MAAM,aAAU;;;;;;;;;;;;;;;;;wBAoBtC,cAAc,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmBhD,sBAAsB,MAAM,aAAU;;;;;;;;;;;;;;;;;wBAoBtC,cAAc,MAAM,YAAY,iBAAgB;;;;;;;;;;;;;;;;wBAmBhD,sBAAsB,MAAM,aAAU"}
|
package/dist/crypto-hash.js
CHANGED
|
@@ -4,16 +4,17 @@ import { createHash } from "node:crypto";
|
|
|
4
4
|
/**
|
|
5
5
|
* Computes the MD5 hash of the given data.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
7
|
+
* @param data - The input data to hash.
|
|
8
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
9
9
|
*
|
|
10
|
-
* @returns
|
|
10
|
+
* @returns The hash digest in the specified encoding.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
14
15
|
* import { cryptoMd5 } from '@kikiutils/shared/crypto-hash';
|
|
15
16
|
*
|
|
16
|
-
* console.log(cryptoMd5('test')); // 098f6bcd4621d373cade4e832627b4f6
|
|
17
|
+
* console.log(cryptoMd5('test')); // => 098f6bcd4621d373cade4e832627b4f6
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
20
|
function cryptoMd5(data, outputEncoding = "hex") {
|
|
@@ -22,15 +23,16 @@ function cryptoMd5(data, outputEncoding = "hex") {
|
|
|
22
23
|
/**
|
|
23
24
|
* Computes the MD5 hash of the given data and returns the raw buffer.
|
|
24
25
|
*
|
|
25
|
-
* @param
|
|
26
|
+
* @param data - The input data to hash.
|
|
26
27
|
*
|
|
27
|
-
* @returns
|
|
28
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
|
-
*
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
31
33
|
* import { cryptoMd5ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
32
34
|
*
|
|
33
|
-
* console.log(cryptoMd5ToBuffer('test')); // <Buffer
|
|
35
|
+
* console.log(cryptoMd5ToBuffer('test')); // => <Buffer 09 8f 6b cd ...>
|
|
34
36
|
* ```
|
|
35
37
|
*/
|
|
36
38
|
function cryptoMd5ToBuffer(data) {
|
|
@@ -39,16 +41,17 @@ function cryptoMd5ToBuffer(data) {
|
|
|
39
41
|
/**
|
|
40
42
|
* Computes the SHA-3 hash of the given data using the 224-bit digest.
|
|
41
43
|
*
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
+
* @param data - The input data to hash.
|
|
45
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
44
46
|
*
|
|
45
|
-
* @returns
|
|
47
|
+
* @returns The hash digest in the specified encoding.
|
|
46
48
|
*
|
|
47
49
|
* @example
|
|
48
|
-
*
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
49
52
|
* import { cryptoSha3224 } from '@kikiutils/shared/crypto-hash';
|
|
50
53
|
*
|
|
51
|
-
* console.log(cryptoSha3224('test')); // 3797bf0afbbfca4a7bbba7602a2b552746876517a7f9b7ce2db0ae7b
|
|
54
|
+
* console.log(cryptoSha3224('test')); // => 3797bf0afbbfca4a7bbba7602a2b552746876517a7f9b7ce2db0ae7b
|
|
52
55
|
* ```
|
|
53
56
|
*/
|
|
54
57
|
function cryptoSha3224(data, outputEncoding = "hex") {
|
|
@@ -57,15 +60,16 @@ function cryptoSha3224(data, outputEncoding = "hex") {
|
|
|
57
60
|
/**
|
|
58
61
|
* Computes the SHA-3 hash of the given data using the 224-bit digest and returns the raw buffer.
|
|
59
62
|
*
|
|
60
|
-
* @param
|
|
63
|
+
* @param data - The input data to hash.
|
|
61
64
|
*
|
|
62
|
-
* @returns
|
|
65
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
63
66
|
*
|
|
64
67
|
* @example
|
|
65
|
-
*
|
|
68
|
+
*
|
|
69
|
+
* ```ts
|
|
66
70
|
* import { cryptoSha3224ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
67
71
|
*
|
|
68
|
-
* console.log(cryptoSha3224ToBuffer('test')); // <Buffer 37 97 bf 0a ...>
|
|
72
|
+
* console.log(cryptoSha3224ToBuffer('test')); // => <Buffer 37 97 bf 0a ...>
|
|
69
73
|
* ```
|
|
70
74
|
*/
|
|
71
75
|
function cryptoSha3224ToBuffer(data) {
|
|
@@ -74,16 +78,17 @@ function cryptoSha3224ToBuffer(data) {
|
|
|
74
78
|
/**
|
|
75
79
|
* Computes the SHA-3 hash of the given data using the 256-bit digest.
|
|
76
80
|
*
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
81
|
+
* @param data - The input data to hash.
|
|
82
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
79
83
|
*
|
|
80
|
-
* @returns
|
|
84
|
+
* @returns The hash digest in the specified encoding.
|
|
81
85
|
*
|
|
82
86
|
* @example
|
|
83
|
-
*
|
|
87
|
+
*
|
|
88
|
+
* ```ts
|
|
84
89
|
* import { cryptoSha3256 } from '@kikiutils/shared/crypto-hash';
|
|
85
90
|
*
|
|
86
|
-
* console.log(cryptoSha3256('test')); // 36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80
|
|
91
|
+
* console.log(cryptoSha3256('test')); // => 36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80
|
|
87
92
|
* ```
|
|
88
93
|
*/
|
|
89
94
|
function cryptoSha3256(data, outputEncoding = "hex") {
|
|
@@ -92,15 +97,16 @@ function cryptoSha3256(data, outputEncoding = "hex") {
|
|
|
92
97
|
/**
|
|
93
98
|
* Computes the SHA-3 hash of the given data using the 256-bit digest and returns the raw buffer.
|
|
94
99
|
*
|
|
95
|
-
* @param
|
|
100
|
+
* @param data - The input data to hash.
|
|
96
101
|
*
|
|
97
|
-
* @returns
|
|
102
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
98
103
|
*
|
|
99
104
|
* @example
|
|
100
|
-
*
|
|
105
|
+
*
|
|
106
|
+
* ```ts
|
|
101
107
|
* import { cryptoSha3256ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
102
108
|
*
|
|
103
|
-
* console.log(cryptoSha3256ToBuffer('test')); // <Buffer 36 f0 28 ...>
|
|
109
|
+
* console.log(cryptoSha3256ToBuffer('test')); // => <Buffer 36 f0 28 ...>
|
|
104
110
|
* ```
|
|
105
111
|
*/
|
|
106
112
|
function cryptoSha3256ToBuffer(data) {
|
|
@@ -109,16 +115,17 @@ function cryptoSha3256ToBuffer(data) {
|
|
|
109
115
|
/**
|
|
110
116
|
* Computes the SHA-3 hash of the given data using the 384-bit digest.
|
|
111
117
|
*
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
118
|
+
* @param data - The input data to hash.
|
|
119
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
114
120
|
*
|
|
115
|
-
* @returns
|
|
121
|
+
* @returns The hash digest in the specified encoding.
|
|
116
122
|
*
|
|
117
123
|
* @example
|
|
118
|
-
*
|
|
124
|
+
*
|
|
125
|
+
* ```ts
|
|
119
126
|
* import { cryptoSha3384 } from '@kikiutils/shared/crypto-hash';
|
|
120
127
|
*
|
|
121
|
-
* console.log(cryptoSha3384('test')); // e516dabb23b6e30026863543282780a3ae0dccf05551cf0295178d7f...
|
|
128
|
+
* console.log(cryptoSha3384('test')); // => e516dabb23b6e30026863543282780a3ae0dccf05551cf0295178d7f...
|
|
122
129
|
* ```
|
|
123
130
|
*/
|
|
124
131
|
function cryptoSha3384(data, outputEncoding = "hex") {
|
|
@@ -127,15 +134,16 @@ function cryptoSha3384(data, outputEncoding = "hex") {
|
|
|
127
134
|
/**
|
|
128
135
|
* Computes the SHA-3 hash of the given data using the 384-bit digest and returns the raw buffer.
|
|
129
136
|
*
|
|
130
|
-
* @param
|
|
137
|
+
* @param data - The input data to hash.
|
|
131
138
|
*
|
|
132
|
-
* @returns
|
|
139
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
133
140
|
*
|
|
134
141
|
* @example
|
|
135
|
-
*
|
|
142
|
+
*
|
|
143
|
+
* ```ts
|
|
136
144
|
* import { cryptoSha3384ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
137
145
|
*
|
|
138
|
-
* console.log(cryptoSha3384ToBuffer('test')); // <Buffer e5 16 da bb ...>
|
|
146
|
+
* console.log(cryptoSha3384ToBuffer('test')); // => <Buffer e5 16 da bb ...>
|
|
139
147
|
* ```
|
|
140
148
|
*/
|
|
141
149
|
function cryptoSha3384ToBuffer(data) {
|
|
@@ -144,16 +152,17 @@ function cryptoSha3384ToBuffer(data) {
|
|
|
144
152
|
/**
|
|
145
153
|
* Computes the SHA-3 hash of the given data using the 512-bit digest.
|
|
146
154
|
*
|
|
147
|
-
* @param
|
|
148
|
-
* @param
|
|
155
|
+
* @param data - The input data to hash.
|
|
156
|
+
* @param outputEncoding - The output encoding. Defaults to `hex`.
|
|
149
157
|
*
|
|
150
|
-
* @returns
|
|
158
|
+
* @returns The hash digest in the specified encoding.
|
|
151
159
|
*
|
|
152
160
|
* @example
|
|
153
|
-
*
|
|
161
|
+
*
|
|
162
|
+
* ```ts
|
|
154
163
|
* import { cryptoSha3512 } from '@kikiutils/shared/crypto-hash';
|
|
155
164
|
*
|
|
156
|
-
* console.log(cryptoSha3512('test')); // 9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7...
|
|
165
|
+
* console.log(cryptoSha3512('test')); // => 9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7...
|
|
157
166
|
* ```
|
|
158
167
|
*/
|
|
159
168
|
function cryptoSha3512(data, outputEncoding = "hex") {
|
|
@@ -162,15 +171,16 @@ function cryptoSha3512(data, outputEncoding = "hex") {
|
|
|
162
171
|
/**
|
|
163
172
|
* Computes the SHA-3 hash of the given data using the 512-bit digest and returns the raw buffer.
|
|
164
173
|
*
|
|
165
|
-
* @param
|
|
174
|
+
* @param data - The input data to hash.
|
|
166
175
|
*
|
|
167
|
-
* @returns
|
|
176
|
+
* @returns A new `Buffer` containing the raw hash digest.
|
|
168
177
|
*
|
|
169
178
|
* @example
|
|
170
|
-
*
|
|
179
|
+
*
|
|
180
|
+
* ```ts
|
|
171
181
|
* import { cryptoSha3512ToBuffer } from '@kikiutils/shared/crypto-hash';
|
|
172
182
|
*
|
|
173
|
-
* console.log(cryptoSha3512ToBuffer('test')); // <Buffer 9e ce 08 6e ...>
|
|
183
|
+
* console.log(cryptoSha3512ToBuffer('test')); // => <Buffer 9e ce 08 6e ...>
|
|
174
184
|
* ```
|
|
175
185
|
*/
|
|
176
186
|
function cryptoSha3512ToBuffer(data) {
|
package/dist/crypto-hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-hash.js","names":[],"sources":["../src/crypto-hash.ts"],"sourcesContent":["import { Buffer } from 'node:buffer';\nimport { createHash } from 'node:crypto';\nimport type { BinaryLike } from 'node:crypto';\n\n/**\n * Computes the MD5 hash of the given data.\n *\n * @param
|
|
1
|
+
{"version":3,"file":"crypto-hash.js","names":[],"sources":["../src/crypto-hash.ts"],"sourcesContent":["import { Buffer } from 'node:buffer';\nimport { createHash } from 'node:crypto';\nimport type { BinaryLike } from 'node:crypto';\n\n/**\n * Computes the MD5 hash of the given data.\n *\n * @param data - The input data to hash.\n * @param outputEncoding - The output encoding. Defaults to `hex`.\n *\n * @returns The hash digest in the specified encoding.\n *\n * @example\n *\n * ```ts\n * import { cryptoMd5 } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoMd5('test')); // => 098f6bcd4621d373cade4e832627b4f6\n * ```\n */\nexport function cryptoMd5(data: BinaryLike, outputEncoding: BufferEncoding = 'hex') {\n return createHash('md5').update(normalizeHashData(data)).digest(outputEncoding);\n}\n\n/**\n * Computes the MD5 hash of the given data and returns the raw buffer.\n *\n * @param data - The input data to hash.\n *\n * @returns A new `Buffer` containing the raw hash digest.\n *\n * @example\n *\n * ```ts\n * import { cryptoMd5ToBuffer } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoMd5ToBuffer('test')); // => <Buffer 09 8f 6b cd ...>\n * ```\n */\nexport function cryptoMd5ToBuffer(data: BinaryLike) {\n return createHash('md5').update(normalizeHashData(data)).digest();\n}\n\n/**\n * Computes the SHA-3 hash of the given data using the 224-bit digest.\n *\n * @param data - The input data to hash.\n * @param outputEncoding - The output encoding. Defaults to `hex`.\n *\n * @returns The hash digest in the specified encoding.\n *\n * @example\n *\n * ```ts\n * import { cryptoSha3224 } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoSha3224('test')); // => 3797bf0afbbfca4a7bbba7602a2b552746876517a7f9b7ce2db0ae7b\n * ```\n */\nexport function cryptoSha3224(data: BinaryLike, outputEncoding: BufferEncoding = 'hex') {\n return createHash('sha3-224').update(normalizeHashData(data)).digest(outputEncoding);\n}\n\n/**\n * Computes the SHA-3 hash of the given data using the 224-bit digest and returns the raw buffer.\n *\n * @param data - The input data to hash.\n *\n * @returns A new `Buffer` containing the raw hash digest.\n *\n * @example\n *\n * ```ts\n * import { cryptoSha3224ToBuffer } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoSha3224ToBuffer('test')); // => <Buffer 37 97 bf 0a ...>\n * ```\n */\nexport function cryptoSha3224ToBuffer(data: BinaryLike) {\n return createHash('sha3-224').update(normalizeHashData(data)).digest();\n}\n\n/**\n * Computes the SHA-3 hash of the given data using the 256-bit digest.\n *\n * @param data - The input data to hash.\n * @param outputEncoding - The output encoding. Defaults to `hex`.\n *\n * @returns The hash digest in the specified encoding.\n *\n * @example\n *\n * ```ts\n * import { cryptoSha3256 } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoSha3256('test')); // => 36f028580bb02cc8272a9a020f4200e346e276ae664e45ee80745574e2f5ab80\n * ```\n */\nexport function cryptoSha3256(data: BinaryLike, outputEncoding: BufferEncoding = 'hex') {\n return createHash('sha3-256').update(normalizeHashData(data)).digest(outputEncoding);\n}\n\n/**\n * Computes the SHA-3 hash of the given data using the 256-bit digest and returns the raw buffer.\n *\n * @param data - The input data to hash.\n *\n * @returns A new `Buffer` containing the raw hash digest.\n *\n * @example\n *\n * ```ts\n * import { cryptoSha3256ToBuffer } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoSha3256ToBuffer('test')); // => <Buffer 36 f0 28 ...>\n * ```\n */\nexport function cryptoSha3256ToBuffer(data: BinaryLike) {\n return createHash('sha3-256').update(normalizeHashData(data)).digest();\n}\n\n/**\n * Computes the SHA-3 hash of the given data using the 384-bit digest.\n *\n * @param data - The input data to hash.\n * @param outputEncoding - The output encoding. Defaults to `hex`.\n *\n * @returns The hash digest in the specified encoding.\n *\n * @example\n *\n * ```ts\n * import { cryptoSha3384 } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoSha3384('test')); // => e516dabb23b6e30026863543282780a3ae0dccf05551cf0295178d7f...\n * ```\n */\nexport function cryptoSha3384(data: BinaryLike, outputEncoding: BufferEncoding = 'hex') {\n return createHash('sha3-384').update(normalizeHashData(data)).digest(outputEncoding);\n}\n\n/**\n * Computes the SHA-3 hash of the given data using the 384-bit digest and returns the raw buffer.\n *\n * @param data - The input data to hash.\n *\n * @returns A new `Buffer` containing the raw hash digest.\n *\n * @example\n *\n * ```ts\n * import { cryptoSha3384ToBuffer } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoSha3384ToBuffer('test')); // => <Buffer e5 16 da bb ...>\n * ```\n */\nexport function cryptoSha3384ToBuffer(data: BinaryLike) {\n return createHash('sha3-384').update(normalizeHashData(data)).digest();\n}\n\n/**\n * Computes the SHA-3 hash of the given data using the 512-bit digest.\n *\n * @param data - The input data to hash.\n * @param outputEncoding - The output encoding. Defaults to `hex`.\n *\n * @returns The hash digest in the specified encoding.\n *\n * @example\n *\n * ```ts\n * import { cryptoSha3512 } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoSha3512('test')); // => 9ece086e9bac491fac5c1d1046ca11d737b92a2b2ebd93f005d7...\n * ```\n */\nexport function cryptoSha3512(data: BinaryLike, outputEncoding: BufferEncoding = 'hex') {\n return createHash('sha3-512').update(normalizeHashData(data)).digest(outputEncoding);\n}\n\n/**\n * Computes the SHA-3 hash of the given data using the 512-bit digest and returns the raw buffer.\n *\n * @param data - The input data to hash.\n *\n * @returns A new `Buffer` containing the raw hash digest.\n *\n * @example\n *\n * ```ts\n * import { cryptoSha3512ToBuffer } from '@kikiutils/shared/crypto-hash';\n *\n * console.log(cryptoSha3512ToBuffer('test')); // => <Buffer 9e ce 08 6e ...>\n * ```\n */\nexport function cryptoSha3512ToBuffer(data: BinaryLike) {\n return createHash('sha3-512').update(normalizeHashData(data)).digest();\n}\n\nfunction normalizeHashData(data: BinaryLike): NodeJS.ArrayBufferView | string {\n return typeof data === 'string' || ArrayBuffer.isView(data) ? data : Buffer.from(data);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,UAAU,MAAkB,iBAAiC,OAAO;CAChF,OAAO,WAAW,KAAK,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO,cAAc;AAClF;;;;;;;;;;;;;;;;AAiBA,SAAgB,kBAAkB,MAAkB;CAChD,OAAO,WAAW,KAAK,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO;AACpE;;;;;;;;;;;;;;;;;AAkBA,SAAgB,cAAc,MAAkB,iBAAiC,OAAO;CACpF,OAAO,WAAW,UAAU,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO,cAAc;AACvF;;;;;;;;;;;;;;;;AAiBA,SAAgB,sBAAsB,MAAkB;CACpD,OAAO,WAAW,UAAU,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO;AACzE;;;;;;;;;;;;;;;;;AAkBA,SAAgB,cAAc,MAAkB,iBAAiC,OAAO;CACpF,OAAO,WAAW,UAAU,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO,cAAc;AACvF;;;;;;;;;;;;;;;;AAiBA,SAAgB,sBAAsB,MAAkB;CACpD,OAAO,WAAW,UAAU,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO;AACzE;;;;;;;;;;;;;;;;;AAkBA,SAAgB,cAAc,MAAkB,iBAAiC,OAAO;CACpF,OAAO,WAAW,UAAU,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO,cAAc;AACvF;;;;;;;;;;;;;;;;AAiBA,SAAgB,sBAAsB,MAAkB;CACpD,OAAO,WAAW,UAAU,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO;AACzE;;;;;;;;;;;;;;;;;AAkBA,SAAgB,cAAc,MAAkB,iBAAiC,OAAO;CACpF,OAAO,WAAW,UAAU,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO,cAAc;AACvF;;;;;;;;;;;;;;;;AAiBA,SAAgB,sBAAsB,MAAkB;CACpD,OAAO,WAAW,UAAU,CAAC,CAAC,OAAO,kBAAkB,IAAI,CAAC,CAAC,CAAC,OAAO;AACzE;AAEA,SAAS,kBAAkB,MAAmD;CAC1E,OAAO,OAAO,SAAS,YAAY,YAAY,OAAO,IAAI,IAAI,OAAO,OAAO,KAAK,IAAI;AACzF"}
|