Skip to content

Instantly share code, notes, and snippets.

@LottieVixen
Created October 26, 2016 16:45
Show Gist options
  • Select an option

  • Save LottieVixen/7aa876fd468a083e3b4f32bbdceb8597 to your computer and use it in GitHub Desktop.

Select an option

Save LottieVixen/7aa876fd468a083e3b4f32bbdceb8597 to your computer and use it in GitHub Desktop.
//--INIT
h2b = {a:['0' ,'1' ,'2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' ,'a' ,'b' ,'c' ,'d' ,'e' ,'f'],
b:['0000','0001','0010','0011','0100','0101','0110','0111','1000','1001','1010','1011','1100','1101','1110','1111']};
hexa = '1c0111001f010100061a024b53535009181c';
hexb = '686974207468652062756c6c277320657965';
hexc = '';
for (var i = 0; i <= hexa.length-1; i++) {
parta = parseInt(hexa.slice(i,i+1),16);
partb = parseInt(hexb.slice(i,i+1),16);
hexc += (parta^partb).toString(16);
};
console.log('\n\n');
console.log('output\n'+hexc+'\n\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment