taniarascia / comments

Comments
7 stars 0 forks source link

bits-bytes-bases-and-a-hex-dump-javascript/ #110

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Understanding Bits, Bytes, and Numerical Bases | Tania Rascia

I was recently tasked with creating a simple command line program that would take an input of a file of unknown contents and print a hex…

https://www.taniarascia.com/bits-bytes-bases-and-a-hex-dump-javascript/

dotnetCarpenter commented 3 years ago

Great article! I was reading it all in the hope of getting some information about doing simple adding on hexadecimal values in a mutable Buffer without converting them to a decimal number.

I've tried to use bitwise XOR buffer[0] ^= 3 but it only seem to work on 1. Probably I'm accessing the Buffer wrong.

Any chance of getting an update on that? Please :)

jakiestfu commented 2 years ago

“Since we want lines of 16 bytes, we can loop through every 16 and slice them into blocks.”

Why do we want lines of 16 bytes? Why not less or more?

taniarascia commented 2 years ago

That's just the way the hex dump is formatted by default.