1.0.0 • Published 4 years ago
@tradle/urlsafe-base64 v1.0.0
python compatible urlsafe base 64 codec
Similar to urlsafe-base64 this library de-/encodes urlsafe base64 strings.
What it does different:
- Offers a
safeandshortvariant with theshortvariant being same asurlsafe-base64and thesafevariant keeping the ending=characters making it compatible with other implementations such as python. - Comes with typescript definitions.
- Uses
Buffer.fromasnew Bufferhas been deprecated for a long time.
Usage
import { short, safe } from '@tradle/urlsafe-base64'
;[ short, safe ].forEach(variant => {
const base64Str = short.encode('hello')
const decoded = short.decode(base64Str)
const original = decoded.toString()
})License
1.0.0
4 years ago