I thought you could make this clearer and possibly faster by using a switch, but initialising the switch constants is beyond me. You need a constexpr version of memcpy, and i couldn't find one that i could use. std::copy is constexpr, but i don't think you can whip up a char* pointing to the result uint64_t in a way that's constexpr. I could write a manual loop to do the copying, but surely that wouldn't reliably be as fast as memcpy.
Anyway, this whole thing reminded me of FourCC codes, where you identify things with four-character ASCII strings, and freely reinterpret those as 32-bit integers whenever it's convenient:
https://en.wikipedia.org/wiki/FourCC