New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

iscanonicalbase64

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iscanonicalbase64

a regular expression to test wether a string is a valid base64, without ambiguity.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
5
-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

is-canonical-base64

a regular expression to test wether a string is a valid base64, without ambiguity.

Base64 encodes bytes (base 256, 8 bits each) as chars each representing 6 bits. That means a one byte buffer necessarily becomes 2 chars, except only the top 2 bits of the last char are used (and the string is then padded with an == to take the spaces those chars would be)

It's recommended that implementations encode zeros here, but many implementations (including node.js's) accept non-zeros here, but just ignore them.

This can be a problem for signed data, because if the signature signs base64, you must retain exactly the encoded representation (including any ambiguity). So, it's good to enforce that ambigious representations are rejected.

License

MIT

FAQs

Package last updated on 21 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts