Skip to content

Commit

Permalink
quick solution add free hash
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-barfoot committed May 15, 2024
1 parent e5d76d5 commit 3f8e5ff
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ <h1>Data preview</h1>
<tbody id="previewTableBody"></tbody>
</table>
</div>
<div id="hashInputContainer">
<h2>Hash Input</h2>
<input type="text" id="hashInput" placeholder="Enter text to hash" />
<button onclick="hashInput()">Hash</button>
<p id="hashOutput"></p>
</div>
<footer>
<p>

<a href="https://github.com/cai4cai/sha1inbrowser/blob/main/README.md">Instructions for use</a> |
<a href="https://cai4cai.ml/terms/">Terms of Service</a> |
<a href="https://cai4cai.ml/privacy/">Privacy Policy</a> |
<a href="https://github.com/cai4cai/sha1inbrowser">View Source on GitHub</a>
</p>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.min.js" integrity="sha512-vc58qvvBdrDR4etbxMdlTt4GBQk1qjvyORR2nrsPsFPyrs+/u5c3+1Ct6upOgdZoIl7eq6k3a1UPDSNAQi/32A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
async function sha1(str) {
Expand All @@ -75,6 +81,12 @@ <h1>Data preview</h1>
.map(v => v.toString(16).padStart(2, '0'))
.join('').slice(0, 10);
}

async function hashInput() {
const input = document.getElementById("hashInput").value;
const hash = await sha1(input);
document.getElementById("hashOutput").innerText = "Hash: " + hash;
}
</script>
<script>
function download(dataurl, filename) {
Expand Down

0 comments on commit 3f8e5ff

Please sign in to comment.