| <!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-1"); |
| |
| jsTestIsAsync = true; |
| |
| var message = asciiToUint8Array("Hello, World!"); |
| var expectedDigest = "0a0a9f2a6772942557ab5355d76af442f8f65e01"; |
| |
| crypto.subtle.digest("sha-1", message).then(function(result){ |
| digest = result; |
| shouldBe("bytesToHexString(digest)", "expectedDigest"); |
| finishJSTest(); |
| }); |
| |
| </script> |
| |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |