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.
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.
84Compare - dart_helper_utils
Dart extensions and helpers for maps, strings, collections, dates, async, and intl formatting.
80Compare - enough_convert
Support for character encodings and codecs missing from dart:convert.
79Compare - bidi
Converts logical RTL strings to their visual representation using the Unicode Bidirectional Algorithm.
74Compare
Works with
Packages commonly used together with hex: ones it builds on, ones built on it, and its own family.
- cborBuilt on hexA Dart library for RFC8949‑compliant CBOR encoding and decoding.
- bip39Built on hexDart implementation of Bitcoin BIP39 Mnemonic code for generating deterministic keys.
- flutter_esc_pos_utilsBuilt on hexGenerate ESC/POS commands to print via Bluetooth, Network, or USB thermal printers.
- argon2Built on hexPure Dart Argon2 algorithm for password hashing across all platforms.
- esc_pos_utilsBuilt on hexGenerate ESC/POS commands to send to thermal printers.
- requestsBuilt on hexA Dart library for HTTP requests inspired by python-requests with cookie storage.
- webauthnBuilt on hexA plugin implementing the WebAuthn authenticator model for generating Public Key Credentials
- ethereumBuilt on hexEthereum JSON RPC 2.0 client for Dart