bug-coreutils
[Top][All Lists]
Advanced

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

Re: Feature request - base64 Filename Safe Alphabet


From: Simon Josefsson
Subject: Re: Feature request - base64 Filename Safe Alphabet
Date: Sun, 01 Jun 2008 14:05:07 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux)

Christopher Kerr <address@hidden> writes:

> 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.

I think --filename-safe is a good idea.  The documentation should
discuss the potential for generating files starting with '-' or '--'.
Patching gnulib's base64.c to support an arbitrary alphabet seems messy.
Patches welcome though.

Regarding the discussion of different characters to use, let me add that
'+' is not a URI safe character, so it would be unsafe from that aspect.

I believe the parameter name clash is the least problematic consequence
that we can chose.

/Simon




reply via email to

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