Last active
August 29, 2015 14:04
-
-
Save merih/5e9e296f25c3304ca9f6 to your computer and use it in GitHub Desktop.
WebCrypto SHA-256 digest + TextEncoder/TextDecoder + Promises + Array.from + Arrow Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.crypto.subtle.digest({ | |
name: "SHA-256" | |
}, new TextEncoder().encode("Hello, World!")) | |
.then(x => console.log(Array.from(x).map(y => y.toString(16)).join(""))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment