Coder Social home page Coder Social logo

Comments (7)

jrwdunham avatar jrwdunham commented on May 22, 2024

Oops. Duh. The original wording is correct. I'm reading my binary backwards. Sorry for the noise. Closing.

from byteseek.

nishihatapalmer avatar nishihatapalmer commented on May 22, 2024

Hey, no problem. Thanks for trying to improve byteseek!

from byteseek.

jrwdunham avatar jrwdunham commented on May 22, 2024

@nishihatapalmer Thanks. Without opening another new issue, is the line ^~87 # 0x87 = 10000111. Match bytes without any of the bitmask bits set. on the same syntax.md page correct? It seems to me that ^~87 should match all bytes with the first three and the last bits unset, i.e.,

00000000
00001000
00010000
00011000
00100000
00101000
00110000
00111000
01000000
01001000
01010000
01011000
01100000
01101000
01110000
01111000

Am I missing something here again?

from byteseek.

nishihatapalmer avatar nishihatapalmer commented on May 22, 2024

That's correct. An any match ~87 on its own would match all the bytes with any of those bits set, but the expression is negated with ^, so it will match all bytes without any of those bits set, which is the list you give.

from byteseek.

nishihatapalmer avatar nishihatapalmer commented on May 22, 2024

A simple way to understand the negation operator ^ is that it gives you a set of bytes containing all the bytes which weren't in the original set.

from byteseek.

jrwdunham avatar jrwdunham commented on May 22, 2024

Oh, yes, I understand the semantics of ~, ^, and &; I was confused about the wording, but now I see that "without any of the bitmask bits set" means "without any of the bits in 10000111 set", i.e., all integers between 0 and 255 whose binary representation (as a string) starts with 0 and ends with 000.

from byteseek.

nishihatapalmer avatar nishihatapalmer commented on May 22, 2024

I can see how it could be confusing... I'll either have to come up with some better examples, or a better explanation...

from byteseek.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.