Skip to content
FutureBlitz

    Install

    Import std.text.encoding

    Hex

    std.text.encoding

    struct

    Public Struct Hex

    Hex, which writes each byte as two of the digits "0" to "9" and "a" to "f".

    Examples

    Expect(Hex.Encode([0xCA, 0xFE] As UInt8[]) == "cafe")
    Expect(Hex.Decode("CAFE") == [0xCA, 0xFE] As UInt8[])

    std/text/encoding.fb, line 291

    • Public Static Method Encode(bytes: UInt8[], upper: Bool = False): String static method #

      bytes as hex, its digits from "A" to "F" when upper says.

    • Public Static Method Decode(text: String): UInt8[]? static method #

      The bytes hex text holds, two digits each, in either case, or Null when it isn't hex.

    Report an issue with this page or with FutureBlitz on GitHub.