struct Length [src]
A length encoded according to NIST SP 800-185.
Fields
len: usize = 0The size of the encoded value, in bytes.
buf: [@sizeOf(usize) + 1]u8 = undefinedA buffer to store the encoded length.
Members
- slice (Function)
Source
pub const Length = struct {
/// The size of the encoded value, in bytes.
len: usize = 0,
/// A buffer to store the encoded length.
buf: [@sizeOf(usize) + 1]u8 = undefined,
/// Return the encoded length as a slice.
pub fn slice(self: *const Length) []const u8 {
return self.buf[0..self.len];
}
}