hex

Generated by tinox doc

Hex encoding/decoding for strings and raw bytes. Hex::decodeBytes/encode operate on byte lists rather than a Tinox String where it matters (e.g. hashing digests), since a Tinox String is an internal C string and would silently truncate at an embedded 0x00 byte.

Encode decode

import tinox.core.hex;

class Main
{
    fnc main() -> Int32
    {
        let encoded: String = Hex::encode("Hi!");
        println(encoded);

        let decoded: String = Hex::decode(encoded);
        println(decoded);

        println(Hex::dump("Hi!"));
        return 0;
    }
}

fn tinoxBytesToString(bytes: List<Int64>) → String

class Hex

Methods

fn encode(data: String) → String
fn decode(hex: String) → String
fn decodeBytes(hex: String) → List<Int64>
fn nibbleToChar(n: Int64) → String
fn charToNibble(c: String) → Int64
fn dump(data: String) → String