Skip to content

Instantly share code, notes, and snippets.

@westonruter
Created February 10, 2010 18:11
Show Gist options
  • Save westonruter/300633 to your computer and use it in GitHub Desktop.
Save westonruter/300633 to your computer and use it in GitHub Desktop.
<?php
define('MD5_INPUT', "Hello, World!");
?>
<script src="gibberish-aes.js"></script>
<pre><?php echo md5(MD5_INPUT); ?></pre>
<pre><script>
var md5_arr = GibberishAES.Hash.MD5(<?php echo json_encode(MD5_INPUT) ?>);
var md5_hex = '';
for(var i = 0; i <md5_arr.length; i++){
var hex = md5_arr[i].toString(16);
if(hex.length == 1)
hex = '0'+hex;
md5_hex += hex;
}
document.write(md5_hex)
</script></pre>
<!--
Results don't match:
65a8e27d8879283831b664bd8b7f0ad4
0b867e53c1d233ce9fe49d54549a2323
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment