Longer strings would represented using a record (so I can self-host most of it), & cache the hash in that record. Or if its not there yet I'd iterate over keys >= 1 to hash the concatenation of them.
Beyond long-strings would be entirely implemented in Lua!
5.5/5.5 Fin for today!