@reventlessdev/rescript-node 2.0.0-alpha.0 → 2.0.0-alpha.1
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/NodeCrypto.res +6 -0
- package/src/NodeCrypto.res.mjs +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 2.0.0-alpha.1 (2026-08-02)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **rescript-node:** add NodeCrypto.sha256Hex convenience ([047d2a2](https://github.com/ReventlessDev/reventless-core/commit/047d2a297cee4738b9daf50b1c988532db8e13df))
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
# 2.0.0-alpha.0 (2026-07-31)
|
|
7
14
|
|
|
8
15
|
* feat(rescript)!: one Node bindings package, not two ([1258d8c](https://github.com/ReventlessDev/reventless-core/commit/1258d8c2b2ff2636b36a849fc5bdf9005c6fb0eb))
|
package/package.json
CHANGED
package/src/NodeCrypto.res
CHANGED
|
@@ -17,6 +17,12 @@ external createHash: string => hash = "createHash"
|
|
|
17
17
|
@send external hashUpdateBuffer: (hash, Uint8Array.t) => hash = "update"
|
|
18
18
|
@send external hashDigest: (hash, string) => string = "digest"
|
|
19
19
|
|
|
20
|
+
/** SHA-256 of a UTF-8 string, hex-encoded. The content hash content-addressed
|
|
21
|
+
stores key their objects on (`sha256/<hash>`): the same bytes always yield the
|
|
22
|
+
same digest, so an upload is idempotent and deduplicating. */
|
|
23
|
+
let sha256Hex = (input: string): string =>
|
|
24
|
+
createHash("sha256")->hashUpdate(input)->hashDigest("hex")
|
|
25
|
+
|
|
20
26
|
// ── HMAC ─────────────────────────────────────────────────────────────────────
|
|
21
27
|
|
|
22
28
|
type hmac
|
package/src/NodeCrypto.res.mjs
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import * as Nodecrypto from "node:crypto";
|
|
4
|
+
|
|
5
|
+
function sha256Hex(input) {
|
|
6
|
+
return Nodecrypto.createHash("sha256").update(input).digest("hex");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
sha256Hex,
|
|
11
|
+
}
|
|
12
|
+
/* node:crypto Not a pure module */
|