byteorder

A lightweight Rust library for reading and writing numbers in big-endian and little-endian order

Library
Cargo
v1.5.0
1,093stars
Unlicense

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
40/100Fair
Development Activity0
Maintenance0
Community72
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture75
Code Quality82
Innovation60
Learning Curve80

byteorder is a small, dependency-free Rust crate that provides convenience methods for encoding and decoding numeric types in either big-endian or little-endian byte order. It centers on a ByteOrder trait with two implementations, BigEndian and LittleEndian, plus NetworkEndian and NativeEndian aliases for clarity, giving callers explicit, type-parameterized control over byte order at every read/write site.

For consumers of std::io, the crate extends the standard Read and Write traits via ReadBytesExt and WriteBytesExt, so numbers can be read from or written to any stream with a single generic method call (rdr.read_u16::<BigEndian>()). It supports no_std environments by disabling the std feature, and automatically provides i128/u128 support on compilers that support it, making it a common low-level building block for binary protocol and file-format parsers.

What You Get

  • A ByteOrder trait implemented by BigEndian and LittleEndian types for converting between byte slices and every standard numeric type
  • ReadBytesExt/WriteBytesExt extension traits that add generic read_u16::<E>()/write_u32::<E>()-style methods to any Read/Write implementor
  • NetworkEndian and NativeEndian aliases for expressing intent (wire-protocol vs. platform-native ordering) without hardcoding a specific endianness
  • Automatic i128/u128 support on compilers where 128-bit integers are available
  • no_std compatibility via a default-on std feature that can be disabled for embedded or kernel-level use

Common Use Cases

  • Parsing binary file formats (image headers, archive formats, serialized data) that specify a fixed byte order
  • Implementing network protocol codecs where multi-byte fields are transmitted in network (big-endian) byte order
  • Writing embedded or no_std firmware code that needs precise control over byte layout without pulling in the standard library
  • Building low-level binary serialization/deserialization layers underneath higher-level format crates

Under The Hood

Architecture - The crate’s public surface lives almost entirely in src/lib.rs (roughly 3,900 lines), centered on a ByteOrder trait with read_uN/write_uN-style methods for every integer width, implemented once each for the zero-sized BigEndian and LittleEndian marker types. src/io.rs is a separate, std-gated module that defines ReadBytesExt/WriteBytesExt as blanket extension traits over std::io::Read/Write, so any stream type automatically gains the generic read_u16::<BigEndian>() style methods without needing a wrapper type. Internal helpers like extend_sign/extend_sign128 handle sign-extension for reading signed integers of non-native widths (e.g. read_i24). Tech Stack - the crate has zero mandatory runtime dependencies; quickcheck and rand are dev-only dependencies used for property-based testing of the read/write round-trip behavior across all supported widths and both endiannesses. #![no_std] is applied conditionally via cfg_attr when the std feature is disabled, and core:: primitives (slice, ptr::copy_nonoverlapping, mem::align_of) are used directly for the low-level byte manipulation. Code Quality - the crate enforces #![deny(missing_docs)], meaning every public item must be documented, and ships roughly 32 #[test]/mod tests blocks combining unit tests and quickcheck-based property tests that round-trip every integer width through both endian orderings. Doc-comments embed compiling, runnable examples (read_u16::<BigEndian>()) that double as documentation tests. API Design - the API pushes byte order into the type system as a generic parameter rather than a runtime argument, which eliminates an entire class of “wrong endianness at runtime” bugs at the cost of slightly more verbose call sites (::<BigEndian>() turbofish syntax); this trade-off, plus the small number of exported items (one trait, two marker types, two extension traits), keeps the crate’s learning curve low despite the exhaustive per-width method surface.

Used by 8 apps in this directory

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Dart
74%
AGPL 3.0

AppFlowy

Productivity · Project Management · Collaboration

75,729

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
66
Dependency
Built with
Dart74%
Rust24%
Updated 1 weeks ago
TypeScript
55%
Other

Cap

Team Chat · Video Conferencing

20,986

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
TypeScript55%
Rust40%
Updated yesterday
Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,247

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust31%
C21%
Updated today
Rust
95%
MIT

Fyrox

Game Development

9,512

A production-ready 2D/3D game engine written in Rust with a built-in scene editor, physics, and hot-reloading game scripts

View details
85
Repo Health
79
Technical
68
Dependency
Built with
Rust95%
Updated yesterday
TypeScript
75%
Other

Jan

AI Assistants

44,052

Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.

View details
90
Repo Health
81
Technical
66
Dependency
Built with
TypeScript75%
Rust21%
Updated today
Rust
100%
Other

Meilisearch

Search

59,012

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
90
Repo Health
88
Technical
68
Dependency
Built with
Rust100%
Updated 5 days ago
Rust
97%
MPL 2.0

Sonic

Databases · Search

21,315

Fast, lightweight, schema-less search backend in Rust — microsecond queries, 30MB RAM, no document storage required.

View details
88
Repo Health
88
Technical
73
Dependency
Built with
Rust97%
Updated 3 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search