HexCodec class

Hexadecimal codec for encoding and decoding text using hexadecimal representation.

This codec converts text to its hexadecimal representation and vice versa. It handles UTF-8 encoding/decoding automatically.

Example:

final codec = HexCodec();
final encoded = codec.encode('Hello'); // 48656c6c6f
final decoded = codec.decode(encoded); // Hello
Implemented types

Constructors

HexCodec.new({bool uppercase = false})
Creates a new Hex codec instance.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
Returns the name/identifier of this codec.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uppercase bool
Whether to use uppercase hex digits.
final

Methods

decode(String input) String
Decodes the input string using the codec's specific algorithm.
override
encode(String input) String
Encodes the input string using the codec's specific algorithm.
override
isValidInput(String input) bool
Optional method to validate if input can be processed by this codec.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited