std/hash
使い方
ArrayBufferで計算したhashが返ってくる
code:sample1.ts
const hash = createHash("md5");
hash.update("Your data here");
const data = hash.digest();
console.log(new Uint8Array(data));
code:sh
toString()で文字列として取得できる
code:sample2.ts
const isBase64 = Deno.args0 === "base64"; const hash = createHash("md5");
hash.update("Your data here");
console.log("hash: ", hash.toString(isBase64 ? "base64" : undefined));
code:sh
一度ArrayBufferまたは文字列を生成したら、もう一度生成することはできない。
実行するとエラーになる
利用できるalgorithms