Lisp and friends

Read a post on one of my fediverse accounts about some interesting code that uses sha1 to do a kinda rot13 thing on text. The post didn’t have any code attached so I replied to the writer to get the Lisp code to do the transformation. This is what they sent me:

(ql:quickload :sha1) (defvar *syllables* '((#\0 . "ze") (#\1 . "wa") (#\2 . "tu") (#\3 . "ri") (#\4 . "fo") (#\5 . "fi") (#\6 . "si") (#\7 . "se") (#\8 . "ye") (#\9 . "ni") (#\A . "he") (#\B . "bi") (#\C . "ki") (#\D . "di") (#\E . "yi") (#\F . "fe"))) (defun shashify (str) (apply #'concatenate (cons 'string (loop for c across (sha1:sha1-hex str) collect (cdr (assoc c *syllables*))))))

Note that this is Common Lisp code, as opposed to other dialects. And WordPress doesn’t know how to display code anymore. I’m going to try to convert this into something I can run on my iPhone. Yes, there’s a few Lisp interpreters on iOS. More details later.