Re: [RFC] RFC4648 encoding
| From: | Sascha Schumann | Date: | Sun, 27 Mar 2016 01:55:10 +0000 |
| Subject: | Re: [RFC] RFC4648 encoding | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91964@lists.php.net to get a copy of this message | ||
> > PHP already offers bin2hex()/hex2bin() and base64_encode()/base64_decode().
> > This covers part, but not all, of RFC 4648.
> >
> > I'd like to extend the coverage to include, at minimum, Base32.
>
> What's the use case for it? Is anybody using base32 now?
I'd have a few times if the functionality had been easily available.
Please make this a single call:
str_convert_base($in, $old_base, $new_base);
"str_" because it applies in most cases to stuff not representable as a PHP
float/int.
> > I'd also like to make these functions to be written to resist cache-timing
> > attacks (i.e. when used to encode/decode encryption keys for long-term
As this requires slowing things down, this should be an extra, optional feature.
Either to the relevant functions, or more likely globally, as it does not make
much sense on a per-function level.
Sascha