Hacker News new | ask | show | jobs
by somewhatjustin 1474 days ago
Thanks for taking a look!

> In case you were interested, there's a section devoted to that in RFC 3548: https://datatracker.ietf.org/doc/html/rfc3548#section-4 with the tl;dr of `s/[+]/-/; s/[/]/_/` and then omitting the trailing "=" characters and just padding the incoming b64 since (AFAIK) one can add as many "=" as they'd like and it'll just ignore extra ones

Thanks! I'll check this out.

> Depending on your interoperability interests, you can shave a bit of text out of it by shortening the JSON key names `"i"`, `"a"`, `"n"`, and then also `.filter(Boolean)` to nuke those two trailing empty strings

This is a good idea. I might already be filtering those empty strings but I'll have to check.