Skip to content

NPM repo for Base64 variant. Can be used without escaping in file names, URL path components/query strings.

License

Notifications You must be signed in to change notification settings

8birds/npm-url-base64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

const urlBase64 = require('url-base64');

let buffer = urlBase64.parseUrlBase64('dXJsLWJhc2U2NA');
let base64Str = urlBase64.convertToUrlBase64(buffer);

url-base64

URL-base64 allows this base-64 variant to be used in URL path components/filenames, as well as query string values.

The Base-64 mapping is the same except '+' is replaced with '-', and '/' is replaced with '_'.

Trailing '=' characters are also omitted. It is assumed that the output buffer will be an integer number of bytes. Since each Base64 digit represents 6 bits, any dangling bits are set to 0 when encoding, and discarded when decoding. It is an error to have non-zero dangling bits.

More info at https://www.armdock.com/url-base64

About

NPM repo for Base64 variant. Can be used without escaping in file names, URL path components/query strings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published