Skip to content

Instantly share code, notes, and snippets.

@pcorpet
Created July 10, 2017 21:43
Show Gist options
  • Save pcorpet/17cd4ef65e279d67f4e0e50d40abb39b to your computer and use it in GitHub Desktop.
Save pcorpet/17cd4ef65e279d67f4e0e50d40abb39b to your computer and use it in GitHub Desktop.
Simple page to SHA-1 hash many strings
<html>
<head>
<script src="https://cdn.rawgit.com/emn178/js-sha1/c724643d/src/sha1.js"></script>
<script>
function hashIt() {
var content = document.getElementById('content').value
document.getElementById('result').innerText =
content.split('\n').map(sha1).join('\n')
}
</script>
</head>
<body style="box-sizing: border-box; margin: 0; display: flex; min-height: 100vh; padding: 10px">
<textarea id="content" style="flex: 1"></textarea>
<button onClick="hashIt()" style="align-self: center; margin: 20px">
Hash It
</button>
<pre id="result" style="flex: 1">
</pre>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment