Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-boudry committed May 18, 2021
1 parent 10bbd37 commit 7cf9a80
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions secret-hash.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,21 @@
<body>

<h2>Input:</h2>
<input required type="text" autocomplete="off" class="encode_sha_param" id="encode_sha_form" style="width:80%">
<input required type="text" autocomplete="off" class="encode_sha_param" id="encode_sha_form" autocomplete="off" style="width:80%">
<br><br>
<strong>Function:</strong>
<select class="encode_function" id="encode_function" required>
<option selected value="SHA-512">SHA-512</option>
<option value="SHA-256">SHA-256</option>
</select>
<br>
<select class="encode_function" id="encode_function" required>
<option selected value="SHA-512">SHA-512</option>
<option value="SHA-256">SHA-256</option>
</select>
<br><br>

<div style="display: none;">
<strong>Iterations:</strong>
<br>
<input type="number" id="encode_iterations" class="encode_iterations" min="1" step="1" value="1" autocomplete="off">
<br>
</div>

<br>
<input type="button" value="Submit" id="valid_button">
Expand All @@ -68,7 +75,7 @@ <h2>Hash:</h2>
var hashFunction = $("#encode_function").val();
var digestHex = $("#encode_sha_form").val();

var iteration = 1;
var iteration = parseInt($("#encode_iterations").val());

for (let i = 0; i < iteration; i++) {
digestHex = await digestMessage(digestHex, hashFunction);
Expand Down

0 comments on commit 7cf9a80

Please sign in to comment.