Debian Codegraph @

README.md

raw symbols SCIP
1 # Object Identifier Library for Rust
2
3 [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)
4
5 [![Build Status](https://travis-ci.org/UnnecessaryEngineering/oid.svg?branch=master)](https://travis-ci.org/UnnecessaryEngineering/oid)
6 [![Crate](https://img.shields.io/crates/v/oid.svg)](https://crates.io/crates/oid)
7 [![codecov](https://codecov.io/gh/UnnecessaryEngineering/oid/branch/master/graph/badge.svg)](https://codecov.io/gh/UnnecessaryEngineering/oid)
8 [![API](https://docs.rs/oid/badge.svg)](https://docs.rs/oid)
9 ![Minimum rustc version](https://img.shields.io/badge/rustc-1.34+-lightgray.svg)
10 [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/UnnecessaryEngineering/oid.svg)](http://isitmaintained.com/project/UnnecessaryEngineering/oid)
11 [![Percentage of issues still open](https://isitmaintained.com/badge/open/UnnecessaryEngineering/oid.svg)](http://isitmaintained.com/project/UnnecessaryEngineering/oid)
12
13 [Object Identifiers] are a standard of the [ITU] used to reference objects, things, and
14 concepts in a globally unique way. This crate provides for data structures and methods
15 to build, parse, and format OIDs.
16
17 ## Basic Utilization
18
19 ### Running Example
20
21 You can run the example code from [examples/basic.rs](examples/basic.rs) using cargo:
22
23 ```sh
24 cargo run --example basic
25 ```
26
27 ### Parsing OID String Representation
28
29 ```rust
30 use oid::prelude::*;
31 let oid = ObjectIdentifier::try_from("0.1.2.3")?;
32 ```
33
34 ### Parsing OID Binary Representation
35
36 ```rust
37 use oid::prelude::*;
38 let oid = ObjectIdentifier::try_from(vec![0x00, 0x01, 0x02, 0x03])?;
39 ```
40
41 ### Encoding OID as String Representation
42
43 ```rust
44 use oid::prelude::*;
45 let oid = ObjectIdentifier::try_from("0.1.2.3")?;
46 let oid: String = oid.into();
47 assert_eq!(oid, "0.1.2.3");
48 ```
49
50 ### Encoding OID as Binary Representation
51
52 ```rust
53 use oid::prelude::*;
54 let oid = ObjectIdentifier::try_from(vec![0x00, 0x01, 0x02, 0x03])?;
55 let oid: Vec<u8> = oid.into();
56 assert_eq!(oid, "0.1.2.3");
57 ```
58
59 ### Adding as a dependency with [cargo-edit]
60
61 ```sh
62 cargo add oid
63 ```
64
65 ### Adding as a dependency with [cargo-edit] for a `!#[no_std]` crate
66
67 ```sh
68 cargo add oid --no-default-features
69 ```
70
71 ### Adding as a dependency directly to `Cargo.toml`
72
73 ```toml
74 [dependencies]
75 oid = "0.1.0"
76 ```
77
78 ### Adding as a dependency directly to `Cargo.toml` for a `!#[no_std]` crate
79
80 ```toml
81 [dependencies]
82 oid = { default-features = false }
83 ```
84
85 ## Building
86
87 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.
88
89 ### Building for a platform with Rust Standard Library
90
91 ```sh
92 cargo make
93 ```
94
95 ### Building for an embedded platform or `#![no_std]`
96
97 ```sh
98 cargo make build_no_std
99 ```
100
101 ### Fuzzing Inputs
102
103 Profiles for [cargo-fuzz] are included for fuzzing the inputs on public method parameters.
104
105 #### Fuzz Binary OID Parsing
106
107 ```sh
108 cargo make fuzz_parse_binary
109 ```
110
111 #### Fuzz String OID Parsing
112
113 ```sh
114 cargo make fuzz_parse_string
115 ```
116
117 ## Contributors ✨
118
119 Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
120
121 <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
122 <!-- prettier-ignore -->
123 <table>
124 <tr>
125 <td align="center"><a href="https://github.com/sbruton"><img src="https://avatars2.githubusercontent.com/u/961430?v=4" width="100px;" alt="Sean Bruton"/><br /><sub><b>Sean Bruton</b></sub></a><br /><a href="https://github.com/UnnecessaryEngineering/oid/commits?author=sbruton" title="Tests">⚠️</a> <a href="https://github.com/UnnecessaryEngineering/oid/commits?author=sbruton" title="Code">💻</a></td>
126 <td align="center"><a href="https://github.com/bcortier-devolutions"><img src="https://avatars2.githubusercontent.com/u/54852465?v=4" width="100px;" alt="Benoît C."/><br /><sub><b>Benoît C.</b></sub></a><br /><a href="https://github.com/UnnecessaryEngineering/oid/commits?author=bcortier-devolutions" title="Tests">⚠️</a> <a href="https://github.com/UnnecessaryEngineering/oid/commits?author=bcortier-devolutions" title="Code">💻</a></td>
127 <td align="center"><a href="https://github.com/snake66"><img src="https://avatars2.githubusercontent.com/u/852601?v=4" width="100px;" alt="snake66"/><br /><sub><b>snake66</b></sub></a><br /><a href="https://github.com/UnnecessaryEngineering/oid/commits?author=snake66" title="Tests">⚠️</a> <a href="https://github.com/UnnecessaryEngineering/oid/commits?author=snake66" title="Code">💻</a></td>
128 </tr>
129 </table>
130
131 <!-- ALL-CONTRIBUTORS-LIST:END -->
132
133 This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
134
135 ## License
136
137 Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option.
138 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.
139
140 [object identifiers]: https://en.wikipedia.org/wiki/Object_identifier
141 [itu]: https://en.wikipedia.org/wiki/International_Telecommunications_Union
142 [cargo-edit]: https://github.com/killercup/cargo-edit
143 [cargo-make]: https://github.com/sagiegurari/cargo-make
144 [cargo-fuzz]: https://github.com/rust-fuzz/cargo-fuzz