Use the custom blocks. The result variable is the result of the encoding or decoding.
Credit to scratch wiki for capitols, and to a forum thread for the original base code for the encoding.