Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/hash.ts>md5

A JavaScript extension package for building strong and modern applications.
Latest
function md5
import { md5 } from "https://deno.land/x/ayonli_jsext@v0.9.72/hash.ts";

Calculates the MD5 hash of the given data.

NOTE: This function is not available in the browser.

Examples

Example 1

import { md5 } from "@ayonli/jsext/hash";

const buffer = await md5("Hello, World!");
console.log(buffer); // ArrayBuffer(16) { ... }

Returns

Promise<ArrayBuffer>

Examples

Example 1

import { md5 } from "@ayonli/jsext/hash";

const hex = await md5("Hello, World!", "hex");
console.log(hex); // 65a8e27d8879283831b664bd8b7f0ad4

const base64 = await md5("Hello, World!", "base64");
console.log(base64); // ZajifYh5KDgxtmS9i38K1A==

Parameters

encoding: "hex" | "base64"

Returns

Promise<string>