structstd.crypto.sha3.NistLengthEncoding.Length[src]

A length encoded according to NIST SP 800-185.

Fields

len: usize = 0

The size of the encoded value, in bytes.

buf: [@sizeOf(usize) + 1]u8 = undefined

A buffer to store the encoded length.

Functions

Functionslice[src]

pub fn slice(self: *const Length) []const u8

Return the encoded length as a slice.

Parameters

self: *const Length

Source Code

Source code
pub fn slice(self: *const Length) []const u8 {
    return self.buf[0..self.len];
}

Source Code

Source code
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];
    }
}