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 basicuse 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");Adding as a dependency with cargo-edit
cargo add oidAdding as a dependency with cargo-edit for a !#[no_std] crate
cargo add oid --no-default-features[dependencies]
oid = "0.3"[dependencies]
oid = { version = "0.3", default-features = false }The build routines have been automated with just. If you're not using just, you can check the justfile for the relevant manual build procedures.
Profiles for cargo-fuzz are included for fuzzing the inputs on public method parameters.
just fuzz-parse-binaryjust fuzz-parse-stringLicensed 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.