summaryrefslogtreecommitdiff
path: root/std/hash/hasher.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/hash/hasher.ts')
-rw-r--r--std/hash/hasher.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/std/hash/hasher.ts b/std/hash/hasher.ts
new file mode 100644
index 000000000..2d941d38f
--- /dev/null
+++ b/std/hash/hasher.ts
@@ -0,0 +1,10 @@
+// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+
+export type Message = string | ArrayBuffer;
+export type OutputFormat = "hex" | "base64";
+
+export interface Hasher {
+ update(data: Message): this;
+ digest(): ArrayBuffer;
+ toString(format?: OutputFormat): string;
+}