FLUTTER ECOSYSTEM

fixnum

Library for 32- and 64-bit signed fixed-width integers with consistent behavior between native and JS runtimes.

Latest version
1.1.1
30-day downloads
5.9M
Likes
67
Pub points
150

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

The fixnum package provides 32-bit and 64-bit signed fixed-width integer types that ensure consistent behavior across Dart's native and JavaScript runtimes. It addresses discrepancies in integer handling between platforms, particularly in web environments where JavaScript uses floating-point numbers for integers. This library is ideal for applications requiring predictable arithmetic and bitwise operations regardless of the execution environment.

Use cases
  • Cross-platform integer consistency
  • Web and native integer synchronization
  • Cryptographic operations
  • Network protocol implementations
  • Binary data processing
  • Low-level system programming
Key features
  • Fixed 32-bit and 64-bit integer types
  • Consistent overflow behavior
  • Bitwise operation support
  • JavaScript runtime compatibility
  • No external dependencies
  • Minimal performance overhead
Suitable for
  • Developers targeting multiple platforms
  • Applications requiring precise integer arithmetic
  • Systems programming in Dart
  • Interoperability with binary protocols
  • Projects needing deterministic integer behavior
Considerations
  • Not needed for basic integer use cases
  • May introduce slight overhead for simple operations
  • Requires explicit import for fixed-width types
  • Limited to signed integers only
  • Not suitable for arbitrary-precision arithmetic
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add fixnum

Categories

Source repository

Related projects