Files
feeddeck/supabase/functions/_shared/utils/md5.ts
Rico Berger 982add8fbb [core] Update Deno Modules (#100)
This commit updates all used Deno modules to their latest version.

Since some of the used modules / functions were deprecated we had to
adjust our encrypt / descrypt functions and the generation of the source
and item ids, where we have to use a new md5 function.
2023-12-12 20:32:44 +01:00

13 lines
300 B
TypeScript

import { crypto } from 'std/crypto';
import { encode } from 'std/hex';
export const md5 = async (str: string): Promise<string> => {
return new TextDecoder().decode(
encode(
new Uint8Array(
await crypto.subtle.digest('MD5', new TextEncoder().encode(str)),
),
),
);
};