def_oid 1.0.0

Define OID into ASN1 bytes format at compile time by using OID arcs literal string
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented2 out of 2 items with examples
  • Size
  • Source code size: 10.13 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 299.26 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • NattapongSiri

def_oid

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.

Use case

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]