| Crates.io | mac-addr |
| lib.rs | mac-addr |
| version | 0.3.0 |
| created_at | 2025-11-06 15:22:05.022918+00 |
| updated_at | 2025-11-08 08:46:05.843534+00 |
| description | Lightweight, no_std compatible MAC address library |
| homepage | |
| repository | https://github.com/shellrow/mac-addr |
| max_upload_size | |
| id | 1919801 |
| size | 35,495 |
Lightweight, dependency-free, no_std compatible MAC address library
supporting both EUI-48 (MacAddr) and EUI-64 (MacAddr8).
It’s designed for portability and low-level use:
alloc for string formattingserde support for serialization and deserializationAdd mac-addr to your dependencies
[dependencies]
mac-addr = "0.3"
use mac_addr::{MacAddr, MacAddr8};
let mac6: MacAddr = "00:25:96:12:34:56".parse().unwrap();
assert_eq!(mac6.to_string(), "00:25:96:12:34:56");
// Convert EUI-48 -> EUI-64
let mac8 = MacAddr8::from_eui48(mac6);
assert_eq!(mac8.to_string(), "00:25:96:ff:fe:12:34:56");
// And back
assert_eq!(mac8.to_eui48().unwrap(), mac6);
For more details, see doc.
| Feature | Default | Description |
|---|---|---|
std |
✅ | Use Rust standard library |
alloc |
⬜ | Enable heap allocation for MacAddr::address() |
serde |
⬜ | Add serde::Serialize / Deserialize implementations |