Skip to content

Instantly share code, notes, and snippets.

@shkaper
Created February 6, 2019 14:57
Show Gist options
  • Save shkaper/911e0892053c9f8ea6bb81ee7d185f87 to your computer and use it in GitHub Desktop.
Save shkaper/911e0892053c9f8ea6bb81ee7d185f87 to your computer and use it in GitHub Desktop.
binary to string
function htos(input){var hex=input.match(/[\s\S]{2}/g)||[];var o='';for(var i=0,j=hex.length;i<j;++i){o+='%'+('0'+hex[i]).slice(-2)}return decodeURIComponent(o)}
htos(parseInt(1101000,2).toString(16))
$(".question-wrapper > p").textContent.split(" ").map((b) => htos(b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment