Comments (3)
This implementation of URL safe Base64 is flawed and will yield invalid encoded values due to missing padding characters. The "general case" language should be assumed in this work.
RFC 4648 The Base16, Base32, and Base64 Data Encodings
3.2. Padding of Encoded Data
In some circumstances, the use of padding ("=") in base-encoded data
is not required or used. In the general case, when assumptions about
the size of transported data cannot be made, padding is required to
yield correct decoded data.
Implementations MUST include appropriate pad characters at the end of
encoded data unless the specification referring to this document
explicitly states otherwise.
The base64 and base32 alphabets use padding, as described below in
sections 4 and 6, but the base16 alphabet does not need it; see
section 8.
from base64url.
Buffer.from("fdsfdsafdsaff|https://cdsf.fdsf.fdsfsd.com/rep|https://lfdjsfjsdfj.fdskfjdsk.com/license").toString('base64');
from base64url.
universally decodable base64 string
No such thing exists, RFC 4646 declares 2 incompatible dialects of base64:
-
"Base 64 Encoding" https://datatracker.ietf.org/doc/html/rfc4648#section-4
-
"Base 64 Encoding with URL and Filename Safe Alphabet", aka "base64url" https://datatracker.ietf.org/doc/html/rfc4648#section-5
The gnu util base64 -D
is only capable of handling "Base 64 Encoding", and will choke on "Base 64 Encoding with URL and Filename Safe Alphabet" or "base64url", what this library uses.
You can't use base64 -D
to decode the output from this library.
from base64url.
Related Issues (20)
- Can we please not put typescript definitions to the final package HOT 11
- Buffer created without "new" HOT 1
- Node.js v7 Buffer Deprecation Warning HOT 1
- Getting "Syntax error: Variable Buffer has already been declared". HOT 1
- Do not publish global typings to npm HOT 3
- Please provide a changelog HOT 1
- Security Vulnerability found on base64url HOT 1
- Missing v3.0.0 tag on git repo?
- Missing definition for the types file
- Vunerability "npm audit" HOT 3
- Node 4 throws "Unexpected token" error in `encode` HOT 1
- Buffer is not defined HOT 14
- react-scripts build: Failed to minify the code from this file HOT 3
- Compatibility issue on IE 11 due to default parameters HOT 1
- ES6 target should be replaced by ES5 HOT 1
- Doesnt work with Angular 7 still getting buffer is not defined HOT 3
- Where can I get the javascript source code without npm? HOT 2
- Decode base64 encoded string HOT 1
- Documentation : browser / React Native compatibility HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from base64url.