Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 17
    Note that the string you used here is slightly different than the original, as echo adds a trailing newline. The original string without it would be correctly padded as ...ifQ==. In this case, both versions do require padding though. Commented Jan 28, 2021 at 19:21
  • 3
    echo -n '{"foo":"bar","baz":"bat"}' | base64 eyJmb28iOiJiYXIiLCJiYXoiOiJiYXQifQ== Commented Feb 1, 2021 at 11:23
  • Keep in mind the "input length" referred to is in bytes. If referring to the number of characters, the length should be divisible by 4. Commented Feb 24, 2022 at 15:44