Skip to content

Instantly share code, notes, and snippets.

@n-kb

n-kb/index.html Secret

Created August 13, 2014 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n-kb/3a7c7a76e20df6bead55 to your computer and use it in GitHub Desktop.
Save n-kb/3a7c7a76e20df6bead55 to your computer and use it in GitHub Desktop.
PASSWORD MAKER
<HTML>
<body>
<script>
function hash() {
s = document.getElementById("quote").value;
h = []
f = ""
for (index = 0; index < s.length; ++index) {
c = s[index];
if (c.match(/[a-z]/i)) {
c = c.toLowerCase();
h.push(c)
}
}
h.sort();
prev_c = "0";
c_count = 0;
for (index = 0; index <= h.length; ++index) {
c = h[index];
if (prev_c == c) {
c_count++;
} else {
if (index > 0) {
f += (c_count + 1).toString() + prev_c
}
c_count = 0;
}
prev_c = c;
}
alert(f);
}
</script>
<input id="quote" type="text">
<input type="submit" onclick="hash()">
</body>
</HTML>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment