# iscanonicalbase64

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

Latest version **1.0.0** (published 2018-10-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install iscanonicalbase64
pnpm add iscanonicalbase64
yarn add iscanonicalbase64
bun add iscanonicalbase64
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-10-21 |
| First published | 2018-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/iscanonicalbase64
- Repository: https://github.com/dominictarr/is-canonical-base64
- Issues: https://github.com/dominictarr/is-canonical-base64/issues
- npm.io page: https://npm.io/package/iscanonicalbase64

## Recent versions

- 1.0.0 (latest) — 2018-10-21

## README

# 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

---
_Source: https://npm.io/package/iscanonicalbase64 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
