From 712f65c3b1b47500f76e8fa26b0483687f870d65 Mon Sep 17 00:00:00 2001 From: Micah Date: Sun, 2 Jun 2024 15:39:40 -0700 Subject: [PATCH] Add types to serde type file --- types/serde.luau | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/types/serde.luau b/types/serde.luau index c4a21d8..ff12714 100644 --- a/types/serde.luau +++ b/types/serde.luau @@ -2,6 +2,19 @@ export type EncodeDecodeFormat = "json" | "yaml" | "toml" export type CompressDecompressFormat = "brotli" | "gzip" | "lz4" | "zlib" +export type HashAlgorithm = + "md5" + | "sha1" + | "sha224" + | "sha256" + | "sha384" + | "sha512" + | "sha3-224" + | "sha3-256" + | "sha3-384" + | "sha3-512" + | "blake3" + --[=[ @class Serde @@ -120,4 +133,16 @@ function serde.decompress(format: CompressDecompressFormat, s: buffer | string): return nil :: any end +function serde.hash(algorithm: HashAlgorithm, message: string | buffer): string + return nil :: any +end + +function serde.hmac( + algorithm: HashAlgorithm, + message: string | buffer, + secret: string | buffer +): string + return nil :: any +end + return serde