(buf: &[u8])
| 143 | /// If slice length is not valid for used buffer kind. |
| 144 | #[inline(always)] |
| 145 | pub fn try_new(buf: &[u8]) -> Result<Self, Error> { |
| 146 | if !K::invariant(buf.len(), BS::USIZE) { |
| 147 | return Err(Error); |
| 148 | } |
| 149 | let mut res = Self::default(); |
| 150 | // SAFETY: we have checked that buffer length satisfies the buffer kind invariant |
| 151 | unsafe { |
| 152 | res.set_data_unchecked(buf); |
| 153 | } |
| 154 | Ok(res) |
| 155 | } |
| 156 | |
| 157 | /// Digest data in `input` in blocks of size `BlockSize` using |
| 158 | /// the `compress` function, which accepts slice of blocks. |
nothing calls this directly
no test coverage detected