I am trying to replicate JS method:
JS code:
const toHexCopy = (buffer) => {
return [...new Uint8Array (buffer)]
.map (b => b.toString (16).padStart (2, "0"))
.join ("");
};
ar = new Uint8Array([0, 1, 2]);
hash = await crypto.subtle.digest('SHA-256', ar)
console.log(toHexCopy(hash))
// returns 039058c6f2c0cb492c533b0a4d14ef77cc0f78abccced5287d84a1a2011cfb81
How do I replicate it in Python?
listor a sequence of bytes? Those are very different questions.