Skip to content
pubscout

hex

0.2.0, released 6 years ago by an unverified publisher

Provides simple HEX.encode and HEX.decode functions for converting between byte lists and hexadecimal strings.

WASM-ready
$ flutter pub add hex
Source repository

What it does

The package offers static methods to encode a list of bytes into a hex string and decode a hex string back into bytes. It uses the built‑in dart:convert API and supports null safety.

AI-written summary of version 0.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to represent binary data as a hex string for APIs or debugging
  • You require a lightweight, dependency‑free way to convert between bytes and hex

Skip it when

  • You need base64 or other encodings
  • You require streaming or high‑performance bulk conversions

Strengths

  • Very small and has zero dependencies
  • Null‑safe and works on all Dart platforms

Weaknesses

  • Only handles hex encoding/decoding
  • No streaming or chunked processing support

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:hex/hex.dart';

void main() {
  final encoded = HEX.encode([1, 2, 3]); // "010203"
  final decoded = HEX.decode('010203'); // [1, 2, 3]
}

Alternatives

Packages that do the same job and could replace hex.

  • fraction

    Create, parse, and perform arithmetic operations with fractions and mixed fractions.

  • dart_helper_utils

    Dart extensions and helpers for maps, strings, collections, dates, async, and intl formatting.

  • enough_convert

    Support for character encodings and codecs missing from dart:convert.

  • bidi

    Converts logical RTL strings to their visual representation using the Unicode Bidirectional Algorithm.

Works with

Packages commonly used together with hex: ones it builds on, ones built on it, and its own family.