Skip to content

Instantly share code, notes, and snippets.

@jackphilippi
Created May 23, 2018 21:38
Show Gist options
  • Save jackphilippi/05155c7243fba881bf1e9ce8ba5b9207 to your computer and use it in GitHub Desktop.
Save jackphilippi/05155c7243fba881bf1e9ce8ba5b9207 to your computer and use it in GitHub Desktop.
let byte = 0;
let shift = 0;
[0, 1, 1, 1, 1, 0, 0, 1]
.map((bit) => {
byte = byte | bit << (7 - shift);
});
console.log(`The input byte evaluates to ${byte}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment