I remember that there was a smarter way to do this, but you can do it manually. Something like: immutable long my_id = 'a' << 24 + 'b' << 16 + 'c' << 8 + 'd'; Or you can create a CTFE function to do this from a string, which should be nicer, if you don't find an existing utility for this.