pub fn read_uint(data: &[u8], size: usize) -> Result<usize, Error>Expand description
Read a script-encoded unsigned integer
§Errors
This function returns an error in these cases:
datais shorter thansize=>EarlyEndOfScriptsizeis greater thanu16::max_value / 8(8191) =>NumericOverflow- The number being read overflows
usize=>NumericOverflow
Note that this does not return an error for size between core::size_of::<usize>()
and u16::max_value / 8 if there’s no overflow.