Closed BafDyce closed 5 years ago
base64_url::encode("aswf!@#$%^&*()")
returns "YXN3ZiFAIyQlXiYqKCk"
"YXN3ZiFAIyQlXiYqKCk"
Attempting to decode this with Linux' base64 binary fails:
$ echo "YXN3ZiFAIyQlXiYqKCk" | base64 -d aswf!@#$%^&*()base64: invalid input
This is the correct base64 encoding (trailing '='!):
'='
$ echo -n 'aswf!@#$%^&*()' | base64 YXN3ZiFAIyQlXiYqKCk=
The base64-crate correctly encodes the string, so I don't know where base64_url goes wrong.
Do you know the difference between Base64-standard and Base64-url?
See https://tools.ietf.org/html/rfc4648#section-5
Oh, sorry. I was not aware that the trailing padding can be optional in base64-url.
returns
"YXN3ZiFAIyQlXiYqKCk"
Attempting to decode this with Linux' base64 binary fails:
This is the correct base64 encoding (trailing
'='
!):The base64-crate correctly encodes the string, so I don't know where base64_url goes wrong.