| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script src="../resources/common.js"></script> |
| </head> |
| <body> |
| <p id="description"></p> |
| <div id="console"></div> |
| |
| <script> |
| description("Test digest with SHA-256"); |
| |
| jsTestIsAsync = true; |
| |
| var message = asciiToUint8Array("Hello, World!"); |
| var expectedDigest = "dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f"; |
| |
| crypto.subtle.digest("sha-256", message).then(function(result){ |
| digest = result; |
| shouldBe("bytesToHexString(digest)", "expectedDigest"); |
| finishJSTest(); |
| }); |
| |
| </script> |
| |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |