[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request - base64 Filename Safe Alphabet

From: Bo Borgerson
Subject: Re: Feature request - base64 Filename Safe Alphabet
Date: Tue, 29 Apr 2008 09:01:34 -0400
User-agent: Thunderbird (X11/20080227)

Christopher Kerr wrote:
> After being burned by using `head -c6 /dev/urandom | base64` as part of a 
> directory name, I realised that it would be useful if base64 had an option to 
> generate URL and Filename safe encodings, as specified in RFC 3548 section 4.
> This would make
> cat FILE | base64 --filename-safe
> equivalent to
> cat FILE | base64 | tr '+/' '-_'
> using the current coreutils tools.


lib/base64.c looks fairly easy to pull apart so that current functions
base64_encode and base64_decode become wrappers around internal
functions that take an additional argument describing the alphabet.

New functions base64_encode_filesafe and base64_decode_filesafe could
then be added without breaking the pre-existing interface or duplicating
a lot of code.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]