def_oid

Crates.iodef_oid
lib.rsdef_oid
version1.0.0
created_at2025-08-07 10:23:40.383557+00
updated_at2025-08-07 10:23:40.383557+00
descriptionDefine OID into ASN1 bytes format at compile time by using OID arcs literal string
homepage
repository
max_upload_size
id1785091
size10,137
(NattapongSiri)

documentation

README

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]
Commit count: 0

cargo fmt