swc/bundler/tests/.cache/deno/1f19c7f6c7f920a1d641403a5a5037fbdc2fe68f.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

38 lines
750 B
TypeScript

// Loaded from https://deno.land/std@0.85.0/hash/mod.ts
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
import { Hash } from "./_wasm/hash.ts";
import type { Hasher } from "./hasher.ts";
export type { Hasher } from "./hasher.ts";
export type SupportedAlgorithm =
| "md2"
| "md4"
| "md5"
| "ripemd160"
| "ripemd320"
| "sha1"
| "sha224"
| "sha256"
| "sha384"
| "sha512"
| "sha3-224"
| "sha3-256"
| "sha3-384"
| "sha3-512"
| "keccak224"
| "keccak256"
| "keccak384"
| "keccak512";
/**
* Creates a new `Hash` instance.
*
* @param algorithm name of hash algorithm to use
*/
export function createHash(algorithm: SupportedAlgorithm): Hasher {
return new Hash(algorithm as string);
}