diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b795d..616223a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Require Dart 3.0 - Add chunked decoding support (`startChunkedConversion`) for `CodePage` encodings. +- Upper-cast the return type of the decoder from `List` to `Uint8List`. ## 3.1.1 diff --git a/lib/src/hex/decoder.dart b/lib/src/hex/decoder.dart index 848a4ae..3696d4d 100644 --- a/lib/src/hex/decoder.dart +++ b/lib/src/hex/decoder.dart @@ -19,10 +19,13 @@ class HexDecoder extends Converter> { const HexDecoder._(); @override - List convert(String input) { + Uint8List convert(String input) { if (!input.length.isEven) { throw FormatException( - 'Invalid input length, must be even.', input, input.length); + 'Invalid input length, must be even.', + input, + input.length, + ); } var bytes = Uint8List(input.length ~/ 2);