DCS World Typescript
    Preparing search index...
    • Decodes Base64 text back into the original (byte) string.

      Input rules:

      • Whitespace (space, tab, CR, LF) is ignored anywhere.
      • Padding is optional ("Zg" and "Zg==" both decode to "f"), but when present it must be correct and only at the end.
      • Any character outside the selected alphabet is an error — including -/_ in "standard" and +// in "url".
      • Unused low bits in the final character are ignored, as most decoders do.

      Parameters

      • text: string

        The Base64 text.

      • Optionaloptions: DecodeOptions

        The alphabet the input uses.

      Returns string

      The decoded bytes.

      If the input is not valid Base64; the message names the problem and its 1-based byte position.