Skip to content

Instantly share code, notes, and snippets.

@drei01
Created June 29, 2012 16:31
Show Gist options
  • Save drei01/3019010 to your computer and use it in GitHub Desktop.
Save drei01/3019010 to your computer and use it in GitHub Desktop.
ecommercehackday puzzle 2012
function bin (text) {
var output = ''
for (var i = 0 ; i < text.length; i+= 8) {
var c = 0;
for (var j=0; j < 8 ; j++) {
c <<= 1;
c |= parseInt(text[i + j]);
}
output += String.fromCharCode(c);
}
return output;
}
$.ajax({
url: '/'+bin('010010010110110101000001010010000110000101100011011010110110010101110010'),
type:'POST',
data: {
action: 'getCode'
},
success: function(response) {
$.each(response,function(key,val){
alert(key);alert(val);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment