diff --git a/src/Crypto.res b/src/Crypto.res index 24e3caf..a0f7d0b 100644 --- a/src/Crypto.res +++ b/src/Crypto.res @@ -31,6 +31,12 @@ KeyObject = { include Impl } +type binaryToTextEncoding = + | @as("base64") Base64 + | @as("base64url") Base64url + | @as("hex") Hex + | @as("binary") Binary + module PivateKey = { include KeyObject.Impl type kind = [KeyObject.privateKey] @@ -60,6 +66,9 @@ module Hash = { @send external copy: t => t = "copy" @send external digest: t => Buffer.t = "digest" @send external update: (t, Buffer.t) => unit = "update" + @send external updateString: (t, string) => t = "update" + @send external updateStringWithEncoding: (t, string, NodeJs.StringEncoding.t) => t = "update" + @send external digestWithEncoding: (t, binaryToTextEncoding) => string = "digest" } include Impl }