encode-base64 <data> to <output data> \ [ input-length <input length> ]Copied!
// Original string, generally this would be binary data in most cases set-string dt =" oh well " // Encode in base64 encode-base64 dt to out_dt decode-base64 out_dt to new_dt if-true dt equal new_dt @Success! else-if @Failure! end-ifCopied!
// Original string, generally this would be binary data in most cases set-string dt =" oh well " // Encode in base64, encode only 6 bytes encode-base64 dt input-length 6 to out_dt decode-base64 out_dt to new_dt // Get length of decoded string string-length new_dt to new_len if-true new_len not-equal 6 @Failure! else-if @Success! end-if if-true dt equal new_dt length new_len @Success! else-if @Failure! [<<p-out dt>>] [<<p-out new_dt>>] end-ifCopied!