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

Re: base64 coding for zsh ?




----- Original Message ----- From: "Marc Chantreux" <marc.chantreux@xxxxxxxxxxxxxxxxxx>
To: <zsh-users@xxxxxxxxxx>
Sent: Thursday, September 14, 2006 10:50 AM
Subject: Re: base64 coding for zsh ?


le 13/09/2006,
Brian K. White nous crivait :
Sent: Wednesday, September 13, 2006 11:08 AM
alias B64enc='openssl base64'
alias B64dec='openssl base64 -d'

I've been using the stand-alone:
http://www.fourmilab.ch/webtools/base64/

I never realised I already had it in openssl.
Thanks for the tip.

I didn't know that before yesterday but it was a bad idea in fact :
openssl base64 doesn't handle utf8 encoded content. So i found recode
command.
finaly :

alias b64dec='recode b64..data'
alias b64enc='recode data..b64'

benches are welcome ;)

---------

Not good but not horrible.
Consistently slower than everything else but only microscopically.
Even though it's the slowest of all, you still have to call it "fast".

nj4:~ # time recode data..b64 </boot/vmlinuz >/dev/null

real    0m0.086s
user    0m0.080s
sys     0m0.008s
nj4:~ #

Brian K. White  --  brian@xxxxxxxxx  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



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