| Crates.io | def_oid |
| lib.rs | def_oid |
| version | 1.0.0 |
| created_at | 2025-08-07 10:23:40.383557+00 |
| updated_at | 2025-08-07 10:23:40.383557+00 |
| description | Define OID into ASN1 bytes format at compile time by using OID arcs literal string |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1785091 |
| size | 10,137 |
Why yet another OID crate ?
This library allow a compile time OID encoded bytes by using one of the two procedural macros oid and const_oid.
Both macro gives a fixed size array of u8 so it's no runtime overhead.
oid is used to get a fixed size bytes of OID. It can be used as expression.
some_function(oid!("2.5.4.3")); // some_function will received [85, 4, 3] of type [u8; 3].
const_oid is used to declare fixed size bytes constant variable.
This is useful for global const declaration.
const_oid!(COMMON_NAME, "2.5.4.3"); // Declare const variable "COMMON_NAME" with type [u8; 3]
println!("{:?}", COMMON_NAME); // it should print [85, 4, 3]