Import std.text.encoding
Base64
struct
Public Struct Base64
Base64, which writes bytes as text of 64 characters and back: each 3 bytes as 4 characters of "A" to "Z", "a" to "z", "0" to "9", "+", and "/", or "-" and "_" for those two in its URL-safe form, which URLs and file names can hold, and "=" filling out the last 4.
Examples
Expect(Base64.Encode("hi!".Bytes) == "aGkh")
Expect(Base64.Decode("aGkh") == "hi!".Bytes)
Expect(Base64.Decode("not base64!") == Null)std/text/encoding.fb, line 245
-
Public Static Method Encode(bytes: UInt8[], urlSafe: Bool = False, padding: Bool = True): Stringstatic method #bytesas Base64, URL-safe whenurlSafesays, and filled out with "=" whenpaddingsays. -
The bytes Base64
textholds, in its URL-safe form whenurlSafesays, with "=" filling out its end or not, or Null when it isn't Base64.
Report an issue with this page or with FutureBlitz on GitHub.