I'm working with UUIDs in PHP and I have to query a database that stores the most significant bits and least significant bits of a UUID in two separate columns. I found this question for Python, which seems like exactly what I'd need in PHP, but I don't know how to convert the code, and I've never been great with byte manipulation.
What would the equivalent functions for getLeastSignificantBits()
and getMostSignificantBits()
be in PHP? Thanks!
Edit: Example data (if helpful):
UUID: b33ac8a9-ae45-4120-bb6e-7537e271808e
...should convert to...
Upper Bits: -5531888561172430560
Lower Bits: -4940882858296115058