blob: 755e111c8d47f305f2a4b8d9df7d92b4a35fd518 [file] [log] [blame] [edit]
<!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");
return crypto.subtle.digest("sha-1", new Uint8Array(0));
}).then(function(result) {
finishJSTest();
});
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>