Function read_uint
pub fn read_uint(data: &[u8], size: usize) -> Result<usize, Error>👎Deprecated since 0.30.0: bitcoin integers are signed 32 bits, use read_scriptint
Expand description
Decodes 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.