This was similar to a PicoCTF challenge, so found a nice walk through for figuring out the last step.

I’m curious how to go the reverse direction though (i.e., start with a string and calculate those values). Does anyone know offhand, or can someone point me in the direction of some reading on the topic?

That hint was perfect. I learned a lot in doing that. Thank you so much. I was almost completely there the whole time, just a little bit of info I was missing.