3 ms·
I think if you work with UUIDs, it's worth learning about bitwise stuff. So backend developers in general. It's not a day-to-day skill, but it is one I've used
by whateveracct 4y ago
I think if you work with UUIDs, it's worth learning about bitwise stuff. So backend developers in general. It's not a day-to-day skill, but it is one I've used at just about every job in the last decade to elegantly and efficiently solve hard problems regarding idempotency and randomness.
- plugin-baby 4y agoWhen would you want to perform bitwise operations on a UUID?
- edflsafoiewq 4y agoA UUID is a bunch of bit fields packed together: the version/variant, and depending on the version, fields for the datetime, MAC address, node ID, etc. You'd use bit ops to both construct and extract the fields.
- whateveracct 4y agoSay you need 5 UUIDs derived from one (say a primary key and some set of idempotency keys). You can mask them.
- JohnFen 4y agoOr if you work directly with hardware, as I do. I use bitwise stuff constantly. Or if you're doing certain obscure kinds of highly optimized mathematical operations.