Skip to content

Instantly share code, notes, and snippets.

@SpEcHiDe
Created June 20, 2016 18:07
Show Gist options
  • Save SpEcHiDe/778dbdb2b8afe8fa648dfe293b839e7f to your computer and use it in GitHub Desktop.
Save SpEcHiDe/778dbdb2b8afe8fa648dfe293b839e7f to your computer and use it in GitHub Desktop.
Code Obfuscator
<!-- textfield to accept input -->
<input type="text" id="f1">
<!-- div to show the output -->
<div id="f2"></div>
<button type="button" onclick="dothis()">Obfuscate</button>
<script>
var dothis = function(){
// create an array of the input value
var values = document.getElementById('f1').value.split('');
for(var i = 0; i < values.length; i++){
// for each character in the input
document.getElementById('f2').innerHTML += values[i].charCodeAt(0) + ",";
// replace it with it's corresponsing ASCII code
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment