I presume the lookup table code comes from the hex2string/string2hex code.
I added it there because it significantly speed up operations with long strings, while keeping compatibility (your shift solution would probably be faster, though).
The reason it works well there is because the strings in question is usually long enough to hide the lookup table version memory access latency.