When uint64_t Just isn’t Quite Enough

In the past, I've built UUID classes in Obj-C, Java, and C++, and in the recent project of my ticker plant, I did it again. It's not hard - you put 16 bytes in a union and allow them to be accessed as bytes, or words, and add a few methods and you're done. But today I realized that those 16 bytes could really be much more if I created a uint128_t. Basically, I created a general 128-bit unsigned integer and then subclassed the UUID off that. It wasn't that hard, but I was trying to encode a generic instrument name, and realized that a uint64_t wasn't going to fit, and it made sense to see if I could make it work with the new 128-bit version.

It didn't take me long, and the code was really pretty primed for it's use. The only thing that remains to be seen is the issue of performance. In general, there's going to be a performance edge to the built-in uint64_t because it's an internal CPU type. But exactly how much performance I give up for that doubling I don't know. We'll have to see as I put it into play.