Create hash from string - anything in Coda like Excel CODE formula?

I want to create a short code ID for for each of my tasks by hashing the task name ie “Take out the garbage” == XDYP or “Clean my room” == HGCP. I was inspired by the second answer to this Stack Overflow:

which is essential to use this formula:


Its a clever way to convert each character into a number and then perform some maths. It doesn’t need to be encryption grade because a collision is no big deal for my tasks.

The key to making it work above is the CODE function in excel which gives you the unicode numeric value of the character, kind of like the inverse of the character() function in coda.

Any ideas on how to do this in Coda?

For the last part: you can create a convertion table and reference it in the formula.

@Asaf_Dafna yes I was hoping to avoid building a whole complex system / table and hoping a couple of formulas strung together would do it / someone had already thought of how to create the hash.

Even with the table, how do you iterate through a string and pull out each letter to look up? I think it would have to be a concoction of formulamap(), length(), and left()?

You can iterate over chars with

Not super efficient since it makes a list, but elegant.