You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected
The common additional characters at the end of the base64 encoded string should be present, this prevents the loss of the last character when it is read by tools that aren't this library.
The text was updated successfully, but these errors were encountered:
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.
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.
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.
Example:
Inp: fdsfdsafdsaff|https://cdsf.fdsf.fdsfsd.com/rep|https://lfdjsfjsdfj.fdskfjdsk.com/license
Outputs:
ZmRzZmRzYWZkc2FmZnxodHRwczovL2Nkc2YuZmRzZi5mZHNmc2QuY29tL3JlcHxodHRwczovL2xmZGpzZmpzZGZqLmZkc2tmamRzay5jb20vbGljZW5zZQ
Testing
Decoding:
$ echo | base64 -D
Outputs:
fdsfdsafdsaff|https://cdsf.fdsf.fdsfsd.com/rep|https://lfdjsfjsdfj.fdskfjdsk.com/licens
Expected
The common additional characters at the end of the base64 encoded string should be present, this prevents the loss of the last character when it is read by tools that aren't this library.
The text was updated successfully, but these errors were encountered: