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
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