#codec #encoding #decoding #endianness #endian

endicon

Implementations of codicon traits for endianness encodings

4 stable releases

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

#13 in Encoding

Download history 1/week @ 2018-12-14 9/week @ 2018-12-21 15/week @ 2018-12-28 6/week @ 2019-01-04 4/week @ 2019-01-11 2/week @ 2019-01-18 1/week @ 2019-01-25 1/week @ 2019-02-01 6/week @ 2019-02-08 4/week @ 2019-02-15 25/week @ 2019-02-22 22/week @ 2019-03-01 84/week @ 2019-03-08 98/week @ 2019-03-15 86/week @ 2019-03-22

113 downloads per month

Apache-2.0

8KB
138 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

~8KB