create2crunch icon indicating copy to clipboard operation
create2crunch copied to clipboard

🐛 Fix leading 0 count bug

Open Philogy opened this issue 2 years ago • 0 comments

Currently the leading zero counting logic has a bug that if an address starts with a non-zero byte but has subsequent zero-bytes e.g. 0xaf0000b3... the logic will essentially skip the leading byte because 0 is used as the "magic value" for recognizing whether the value has been set yet.

I thought of going the Rust way and using options but I assume that has some overhead which wouldn't be good here? Using the unreachable 21 as the magic value fixes this.

Philogy avatar Feb 05 '24 02:02 Philogy