Crates.io | oid |
lib.rs | oid |
version | 0.2.1 |
source | src |
created_at | 2019-07-24 06:31:42.76425 |
updated_at | 2020-09-19 15:32:32.775558 |
description | Rust-native library for building, parsing, and formating Object Identifiers (OIDs) |
homepage | https://labs.unnecessary.engineering/oid |
repository | https://github.com/UnnecessaryEngineering/oid |
max_upload_size | |
id | 151276 |
size | 51,763 |
Object Identifiers are a standard of the ITU used to reference objects, things, and concepts in a globally unique way. This crate provides for data structures and methods to build, parse, and format OIDs.
You can run the example code from examples/basic.rs using cargo:
cargo run --example basic
use oid::prelude::*;
let oid = ObjectIdentifier::try_from("0.1.2.3")?;
use oid::prelude::*;
let oid = ObjectIdentifier::try_from(vec![0x00, 0x01, 0x02, 0x03])?;
use oid::prelude::*;
let oid = ObjectIdentifier::try_from("0.1.2.3")?;
let oid: String = oid.into();
assert_eq!(oid, "0.1.2.3");
use oid::prelude::*;
let oid = ObjectIdentifier::try_from(vec![0x00, 0x01, 0x02, 0x03])?;
let oid: Vec<u8> = oid.into();
assert_eq!(oid, "0.1.2.3");
cargo add oid
!#[no_std]
cratecargo add oid --no-default-features
Cargo.toml
[dependencies]
oid = "0.1.0"
Cargo.toml
for a !#[no_std]
crate[dependencies]
oid = { default-features = false }
The build routines have been automated with cargo-make. If you're not using cargo-make, you can check [Makefile.toml] for the relevant manual build procedures.
cargo make
#![no_std]
cargo make build_no_std
Profiles for cargo-fuzz are included for fuzzing the inputs on public method parameters.
cargo make fuzz_parse_binary
cargo make fuzz_parse_string
Thanks goes to these wonderful people (emoji key):
Sean Bruton ⚠️ 💻 |
Benoît C. ⚠️ 💻 |
snake66 ⚠️ 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this library by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.