@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 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
@@ -0,0 +1,5 @@
1
+ declare function sha256(input: string): string;
2
+
3
+ declare function md5(input: string): string;
4
+
5
+ export { md5, sha256 };
package/hash.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare function sha256(input: string): string;
2
+
3
+ declare function md5(input: string): string;
4
+
5
+ export { md5, sha256 };
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
@@ -1,6 +1,7 @@
1
1
  module.exports = {
2
2
  ...require('./basic.cjs'),
3
3
  ...require('./crypto.cjs'),
4
+ ...require('./hash.cjs'),
4
5
  ...require('./loadEnv.cjs'),
5
6
  ...require('./markets/types.cjs'),
6
7
  ...require('./markets/utils.cjs'),
package/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './basic.js'
2
2
  export * from './crypto.js'
3
+ export * from './hash.js'
3
4
  export * from './loadEnv.js'
4
5
  export * from './markets/types.js'
5
6
  export * from './markets/utils.js'
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './basic.js'
2
2
  export * from './crypto.js'
3
+ export * from './hash.js'
3
4
  export * from './loadEnv.js'
4
5
  export * from './markets/types.js'
5
6
  export * from './markets/utils.js'
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './basic.js'
2
2
  export * from './crypto.js'
3
+ export * from './hash.js'
3
4
  export * from './loadEnv.js'
4
5
  export * from './markets/types.js'
5
6
  export * from './markets/utils.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/shared",
3
- "version": "0.3.7",
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",