I found similar question here, but it lacks information about the "binary" encoding. TextEncoder
is (seemingly) not an equivalent for "binary" in Deno.
Here is an example:
Deno
const str = "ºRFl¶é(÷LõÎW0 Náò8ìÉPPv\0";
const bytes = new TextEncoder().encode(str);
console.log(crypto.createHash("sha256").update(bytes).digest("hex"));
Outputs: 65e16c433fdc795b29668dc1d189b79f2b809dc4623b03c0b9c551bd83d67069
Node
const str = "ºRFl¶é(÷LõÎW0 Náò8ìÉPPv\0";
const buffer = Buffer.from(str, "binary");
console.log(crypto.createHash("sha256").update(buffer).digest("hex"));
Node outputs: fb6d4a2f86e91b13fe2d5a6d2e6ebb9b6f66e18a733b68acbf9ac3c5e56571d0