Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. function next0Bit (b) {
  2. if (b === 255) return -1
  3. if ((b & 240) === 240) {
  4. if ((b & 12) === 12) return (b & 2) === 2 ? 7 : 6
  5. return (b & 8) === 8 ? 5 : 4
  6. }
  7. if ((b & 192) === 192) {
  8. return (b & 32) === 32 ? 3 : 2
  9. }
  10. return (b & 128) === 128 ? 1 : 0
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement