#codec #encoding #decoding #endianness #endian

endicon

Implementations of codicon traits for endianness encodings

3 stable releases

new 1.2.0 Feb 14, 2019
1.1.0 Jan 1, 2019
1.0.0 Oct 10, 2018

#29 in Encoding

Download history 3/week @ 2018-10-20 10/week @ 2018-10-27 5/week @ 2018-11-03 5/week @ 2018-11-10 1/week @ 2018-11-17 2/week @ 2018-11-24 9/week @ 2018-12-01 2/week @ 2018-12-08 2/week @ 2018-12-15 8/week @ 2018-12-22 16/week @ 2018-12-29 5/week @ 2019-01-05 5/week @ 2019-01-12 1/week @ 2019-01-19 2/week @ 2019-01-26

17 downloads per month

Apache-2.0

8KB
134 lines

Build Status Rust Version 1.28+ Crate Docs

Endicon implements the codicon crate traits for doing endianness-based encoding and decoding on integers. See the documentation for full details.

Install

Run this command:

$ cargo add endicon

lib.rs:

Implements endianness encodings using the codicon traits.

See the codicon crate for details.

Examples

extern crate codicon;
extern crate endicon;

use endicon::Endianness;
use codicon::Encoder;

let mut bytes = [0u8; 2];
let little = [1u8, 0u8];
let big = [0u8, 1u8];

1u16.encode(&mut bytes.as_mut(), Endianness::Little).unwrap();
assert_eq!(bytes, little);

1u16.encode(&mut bytes.as_mut(), Endianness::Big).unwrap();
assert_eq!(bytes, big);

Dependencies

~7KB