byte_converter 2.3.1 copy "byte_converter: ^2.3.1" to clipboard
byte_converter: ^2.3.1 copied to clipboard

High-performance byte and data-rate conversions with BigInt precision, expression parsing, transfer planning, storage profiles, and localization-ready formatting.

ByteConverter #

Pub Version License: MIT

Fast, dependable byte and data-rate conversions for Dart with fluent APIs and optional BigInt precision.

โœจ Highlights #

  • ๐Ÿš€ Instant parsing and formatting for bytes, bits, and rates across SI, IEC, and JEDEC standards
  • ๐Ÿงฎ Expression-friendly math with operators, durations, and auto unit detection
  • ๐Ÿง  BigInt precision via BigByteConverter plus matching DataRate and BigDataRate APIs
  • ๐Ÿ•’ Transfer planning helpers that surface ETAs, progress, and burst windows in a single call
  • ๐Ÿ“ฆ Storage profiles with configurable alignment, slack inspection, and round-to-profile helpers
  • ๐Ÿ“Š Aggregate metrics through ByteStats/BigByteStats for sums, averages, percentiles, and histograms
  • ๐ŸŒ Localization-ready humanize output with custom format options, optional intl integration, and built-in unit names for English (including en_IN), German, French, Hindi, Spanish, Portuguese, Japanese, Chinese, and Russian
  • ๐Ÿงพ FormatterSnapshot generators that keep README/wiki matrices and snapshot tests in sync

๐Ÿ“ฆ Installation #

dependencies:
  byte_converter: ^2.3.1

๐Ÿ’ก Quick Example #

import 'package:byte_converter/byte_converter.dart';

void main() {
  final size = ByteConverter.parse('2.5 GB');
  final rate = DataRate.parse('150 Mbps');
  final plan = size.estimateTransfer(rate);

  print(size.toHumanReadableAuto()); // 2.5 GB
  print(plan.etaString());           // friendly ETA string
}

๐Ÿ› ๏ธ Common Tasks #

// Expression-aware parsing and humanizing
final payload = ByteConverter.parse('(1 GiB + 512 MiB) - 256 MB');
print(payload.toHumanReadableAuto());

// Transfer windows and alignment checks
final burst = DataRate.parse('500 Mbps').transferableBytes(const Duration(seconds: 10));
final aligned = burst.roundToProfile(
  StorageProfile.singleBlock('object', blockSizeBytes: 4 * 1024 * 1024),
);

// Aggregations across mixed inputs
final total = ByteStats.sum([
  payload,
  burst,
  ByteConverter.parse('750 MB'),
]);
print(total.toHumanReadableAuto());

๐Ÿ“š Documentation #

The complete guide lives in the wiki:

๐Ÿ”Œ Optional Add-ons #

  • byte_converter_intl.dart opt-in delivers locale-aware number formatting and localized unit names
  • Built-in localized vocabulary now spans English (including en_IN), German, French, Hindi (hi/hi_IN), Spanish (es), Portuguese (pt), Japanese (ja), Chinese (zh), and Russian (ru)
  • FormatterSnapshot helpers keep README tables, wiki docs, and snapshot tests aligned
  • Wiki recipes cover CLI usage, monitoring dashboards, and BigInt-heavy workloads

๐Ÿค Contributing #

Issues and pull requests are welcome. Check the issue tracker to report bugs or request features.

๐Ÿ“„ License #

Released under the MIT License.

6
likes
150
points
2.96k
downloads

Publisher

verified publisherarunprakashg.com

Weekly Downloads

High-performance byte and data-rate conversions with BigInt precision, expression parsing, transfer planning, storage profiles, and localization-ready formatting.

Repository (GitHub)
View/report issues

Topics

#bytes #data-conversion #unit-conversion #formatting #bigint

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

intl

More

Packages that depend on byte_converter