@polymarbot/shared 0.3.7 → 0.3.8
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/hash.cjs +38 -0
- package/hash.d.cts +5 -0
- package/hash.d.ts +5 -0
- package/hash.js +14 -0
- package/index.cjs +1 -0
- package/index.d.cts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +11 -1
package/hash.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/hash.ts
|
|
21
|
+
var hash_exports = {};
|
|
22
|
+
__export(hash_exports, {
|
|
23
|
+
md5: () => md5,
|
|
24
|
+
sha256: () => sha256
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(hash_exports);
|
|
27
|
+
var import_crypto = require("crypto");
|
|
28
|
+
function sha256(input) {
|
|
29
|
+
return (0, import_crypto.createHash)("sha256").update(input).digest("hex");
|
|
30
|
+
}
|
|
31
|
+
function md5(input) {
|
|
32
|
+
return (0, import_crypto.createHash)("md5").update(input).digest("hex");
|
|
33
|
+
}
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
md5,
|
|
37
|
+
sha256
|
|
38
|
+
});
|
package/hash.d.cts
ADDED
package/hash.d.ts
ADDED
package/hash.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./chunk-JSBRDJBE.js";
|
|
2
|
+
|
|
3
|
+
// src/utils/hash.ts
|
|
4
|
+
import { createHash } from "crypto";
|
|
5
|
+
function sha256(input) {
|
|
6
|
+
return createHash("sha256").update(input).digest("hex");
|
|
7
|
+
}
|
|
8
|
+
function md5(input) {
|
|
9
|
+
return createHash("md5").update(input).digest("hex");
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
md5,
|
|
13
|
+
sha256
|
|
14
|
+
};
|
package/index.cjs
CHANGED
package/index.d.cts
CHANGED
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polymarbot/shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,6 +36,16 @@
|
|
|
36
36
|
"default": "./crypto.cjs"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
+
"./hash": {
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./hash.d.ts",
|
|
42
|
+
"default": "./hash.js"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./hash.d.cts",
|
|
46
|
+
"default": "./hash.cjs"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
39
49
|
"./loadEnv": {
|
|
40
50
|
"import": {
|
|
41
51
|
"types": "./loadEnv.d.ts",
|