MetadataProvider and update

Peter Schober peter.schober at univie.ac.at
Thu May 11 19:38:38 EDT 2017


* Tom Scavo <trscavo at gmail.com> [2017-05-12 00:51]:
> Wow, that's very interesting. I wonder if there are tools that
> support the base64url encoding? (The *nix base64 command doesn't
> seem to help.)

Here's an example of wrapping base64 functions the way Brent
suggested, for PHP:
http://php.net/manual/de/function.base64-encode.php#103849
With (unneeded, as the padding isn't relevant for file system use,
AFAIU) corrections suggested here:
http://php.net/manual/de/function.base64-encode.php#119327

So I guess wrapping the GNU coreutils' or openssl's base64 commands
with a pipe into `tr '+/' '-_'` (as suggested by Tom) would be easiest
(as those don't seem to support that, at least not on a Debian stable
release).
Also, in Python 2 and 3 there's long been support for this:
  import base64
  base64.urlsafe_b64encode('someurl'.encode())

-peter


More information about the users mailing list