Skip to content

Commit f6054bf

Browse files
authored
Merge pull request #31 from muqiuhan/feat.crypto.hash.1
2 parents a8252a2 + 71b525d commit f6054bf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Crypto.res

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ KeyObject = {
3131
include Impl
3232
}
3333

34+
type binaryToTextEncoding =
35+
| @as("base64") Base64
36+
| @as("base64url") Base64url
37+
| @as("hex") Hex
38+
| @as("binary") Binary
39+
3440
module PivateKey = {
3541
include KeyObject.Impl
3642
type kind = [KeyObject.privateKey]
@@ -60,6 +66,9 @@ module Hash = {
6066
@send external copy: t => t = "copy"
6167
@send external digest: t => Buffer.t = "digest"
6268
@send external update: (t, Buffer.t) => unit = "update"
69+
@send external updateString: (t, string) => t = "update"
70+
@send external updateStringWithEncoding: (t, string, NodeJs.StringEncoding.t) => t = "update"
71+
@send external digestWithEncoding: (t, binaryToTextEncoding) => string = "digest"
6372
}
6473
include Impl
6574
}

0 commit comments

Comments
 (0)