paulmillr / scure-base

Secure, audited & 0-deps implementation of bech32, base64, base32, base16 & base58
https://paulmillr.com/noble/#scure
MIT License
106 stars 13 forks source link

Feature request: add option to make base32 padding optional #33

Closed benjreinhart closed 2 months ago

benjreinhart commented 3 months ago

Some third-party and/or standard libraries support optional padding when encoding and decoding.

User facing ids that look like the below are an eyesore.

> base32.encode(crypto.getRandomValues(new Uint8Array(16)))
'7CI63KSR5ANU3BKSLYUFTGYQPM======'

I'm wondering if you would be open to adding a {padding: false} option or doing something like https://github.com/paulmillr/scure-base/issues/4 for base32 as well?

paulmillr commented 3 months ago

you can add it as base32nopad if you need it