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

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

๐Ÿ”ข ByteConverter #

A fast, comprehensive byte & data-rate conversion library for Dart

Pub Version License: MIT Dart 3

๐Ÿ“– Documentation ยท ๐Ÿ› Report Bug ยท ๐Ÿ’ก Request Feature


โœจ Features #

Feature Description
๐Ÿ“ Multi-Standard SI (KB, MB, GB), IEC (KiB, MiB, GiB), and JEDEC support
๐Ÿ” Smart Parsing Parse any format: "1.5 GB", "2 GiB + 512 MiB", "1,234 bytes"
๐Ÿ”ข BigInt Support Arbitrary precision for massive values (YB, ZiB, and beyond)
๐Ÿš€ Data Rates Full bits/bytes per second with transfer time estimation
๐ŸŒ 9 Languages Built-in localization: EN, DE, FR, ES, PT, HI, JA, ZH, RU
๐ŸŽฏ Clean API Namespace-based: display, storage, rate, compare, accessibility
โ™ฟ Accessible Screen reader friendly output & ARIA labels
๐Ÿ“Š Statistics Streaming quantiles, percentiles, and aggregation

๐Ÿš€ Quick Start #

Installation #

dependencies:
  byte_converter: ^2.5.0

Basic Usage #

import 'package:byte_converter/byte_converter.dart';

void main() {
  // ๐Ÿ“ฆ Create from any unit
  final size = ByteConverter.fromGigaBytes(1.5);
  
  // ๐ŸŽจ Display formats
  print(size.display.auto());    // "1.5 GB"
  print(size.display.fuzzy());   // "about 1.5 GB"
  print(size.display.gnu());     // "1.5G"
  
  // ๐Ÿ” Parse strings (even expressions!)
  final parsed = ByteConverter.parse('2 GiB + 512 MiB');
  print(parsed.gigaBytes);       // 2.68...
  
  // ๐Ÿš€ Data rates & transfer estimation
  final rate = DataRate.parse('100 Mbps');
  final plan = size.estimateTransfer(rate);
  print(plan.etaString());       // "~2 minutes"
}

๐Ÿ“ฆ Import Options #

// ๐ŸŽฏ Core (most use cases)
import 'package:byte_converter/byte_converter.dart';

// ๐Ÿ”ฅ Full (statistics, streaming, interop)
import 'package:byte_converter/byte_converter_full.dart';

// ๐ŸŒ Localization (with intl package)
import 'package:byte_converter/byte_converter_intl.dart';

// ๐Ÿชถ Lightweight (no intl dependency)
import 'package:byte_converter/byte_converter_lite.dart';

๐ŸŽฏ Namespace API #

final size = ByteConverter.fromMegaBytes(1536);

// ๐ŸŽจ Display - formatting options
size.display.auto()        // "1.5 GB"
size.display.fuzzy()       // "about 1.5 GB"
size.display.scientific()  // "1.5 ร— 10โน B"

// ๐Ÿ’พ Storage - disk alignment
size.storage.sectors       // 3000000 (512B sectors)
size.storage.blocks        // 375000 (4KB blocks)

// ๐Ÿ“ก Rate - network calculations
size.rate.bitsPerSecond    // 12884901888.0
size.rate.transferTime(rate) // Duration

// ๐Ÿ“Š Compare - size comparisons
size.compare.percentOf(total)     // 15.0
size.compare.percentageBar(total) // "โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘"

// โ™ฟ Accessibility
size.accessibility.screenReader() // "one point five gigabytes"

๐Ÿ“š Documentation #

Resource Description
๐Ÿ“– Wiki Full documentation
๐Ÿ Getting Started Installation & setup
๐Ÿ“ Usage Guide Core functionality
๐Ÿงฐ Utilities Advanced features
๐Ÿ”„ Migration Guide Upgrading to v2.5.0

Made with โค๏ธ for the Dart community

โญ Star on GitHub ยท ๐Ÿ“ฆ View on pub.dev

7
likes
140
points
4.29k
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