Skip to content

Commit

Permalink
contrib update
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Bruton <[email protected]>
  • Loading branch information
sbruton committed Sep 3, 2020
1 parent 761debb commit 77d153c
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Object Identifier Library for Rust

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)

[![Build Status](https://travis-ci.org/UnnecessaryEngineering/oid.svg?branch=master)](https://travis-ci.org/UnnecessaryEngineering/oid)
Expand All @@ -16,24 +17,29 @@ to build, parse, and format OIDs.
## Basic Utilization

### Running Example

You can run the example code from [examples/basic.rs](examples/basic.rs) using cargo:

```sh
cargo run --example basic
```

### Parsing OID String Representation

```rust
use oid::prelude::*;
let oid = ObjectIdentifier::try_from("0.1.2.3")?;
```

### Parsing OID Binary Representation

```rust
use oid::prelude::*;
let oid = ObjectIdentifier::try_from(vec![0x00, 0x01, 0x02, 0x03])?;
```

### Encoding OID as String Representation

```rust
use oid::prelude::*;
let oid = ObjectIdentifier::try_from("0.1.2.3")?;
Expand All @@ -42,6 +48,7 @@ assert_eq!(oid, "0.1.2.3");
```

### Encoding OID as Binary Representation

```rust
use oid::prelude::*;
let oid = ObjectIdentifier::try_from(vec![0x00, 0x01, 0x02, 0x03])?;
Expand All @@ -50,22 +57,26 @@ assert_eq!(oid, "0.1.2.3");
```

### Adding as a dependency with [cargo-edit]

```sh
cargo add oid
```

### Adding as a dependency with [cargo-edit] for a `!#[no_std]` crate

```sh
cargo add oid --no-default-features
```

### Adding as a dependency directly to `Cargo.toml`
### Adding as a dependency directly to `Cargo.toml`

```toml
[dependencies]
oid = "0.1.0"
```

### Adding as a dependency directly to `Cargo.toml` for a `!#[no_std]` crate

```toml
[dependencies]
oid = { default-features = false }
Expand All @@ -76,11 +87,13 @@ 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.

### Building for a platform with Rust Standard Library

```sh
cargo make
```

### Building for an embedded platform or `#![no_std]`

```sh
cargo make build_no_std
```
Expand All @@ -90,11 +103,13 @@ cargo make build_no_std
Profiles for [cargo-fuzz] are included for fuzzing the inputs on public method parameters.

#### Fuzz Binary OID Parsing

```sh
cargo make fuzz_parse_binary
```

#### Fuzz String OID Parsing

```sh
cargo make fuzz_parse_string
```
Expand All @@ -107,7 +122,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- prettier-ignore -->
<table>
<tr>
<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>
<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>
<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>
</tr>
</table>

Expand All @@ -117,11 +134,11 @@ This project follows the [all-contributors](https://github.com/all-contributors/

## License

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option.
Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) 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.

[Object Identifiers]: https://en.wikipedia.org/wiki/Object_identifier
[ITU]: https://en.wikipedia.org/wiki/International_Telecommunications_Union
[object identifiers]: https://en.wikipedia.org/wiki/Object_identifier
[itu]: https://en.wikipedia.org/wiki/International_Telecommunications_Union
[cargo-edit]: https://github.com/killercup/cargo-edit
[cargo-make]: https://github.com/sagiegurari/cargo-make
[cargo-fuzz]: https://github.com/rust-fuzz/cargo-fuzz

0 comments on commit 77d153c

Please sign in to comment.