mirror of
https://github.com/feeddeck/feeddeck.git
synced 2026-05-22 23:11:06 -05:00
Instead of using an `import_map.json` file to define the versions for dependencies, they are now defined directly within the import. Since the `import_map.json` file should not be used anymore and instead a `deno.json` file per function should be used, we decided to define them directly with the code. The overhead compared to a `deno.json` file per function shouldn't be that large and it makes using functions in a self-hosted setup easier.
13 lines
371 B
TypeScript
13 lines
371 B
TypeScript
import { crypto } from "https://deno.land/std@0.208.0/crypto/mod.ts";
|
|
import { encode } from "https://deno.land/std@0.208.0/encoding/hex.ts";
|
|
|
|
export const md5 = async (str: string): Promise<string> => {
|
|
return new TextDecoder().decode(
|
|
encode(
|
|
new Uint8Array(
|
|
await crypto.subtle.digest("MD5", new TextEncoder().encode(str)),
|
|
),
|
|
),
|
|
);
|
|
};
|