Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: base64 coding for zsh ?



On Sep 12,  5:08pm, Marc Chantreux wrote:
}
} Now i want my function to deal with base64. The fact is, i don't know
} how to do it.
} 
} Someone can help ? 

It's about 50 lines of readably-formatted C code to write a base64
decoder, slightly more than that to write the encoder, not counting the
lookup tables. It could be done in shell script, but it would be very
slow and probably not worth the effort.

alias enB64="perl -MMIME::Base64 -e 'print encode_base64(shift @ARGV)'"
alias deB64="perl -MMIME::Base64 -e 'print decode_base64(shift @ARGV)'"

enB64 abcdef
deB64 YWJjZGVm



Messages sorted by: Reverse Date, Date, Thread, Author