I'm trying to do an optimization here: a hash function which expect a ubye[] array as argument, would just work if I cast string to ubyte[] but I need to convert it to upper case, so I'd like to do that lazily, so that the byte is converted to its upper case version soon as it's requested. I'm not sure if this possible because I think the function should also work with Range and not ubyte[] to work.

So, adding some code example, can I convert the string to upper case then convert it to ubyte[] without memory allocation? something like this:


import xxhash;
import std.uni : asUpperCase;
uint hash = xxhashOf(cast(ubyte[])(word.asUpperCase));

Reply via email to