You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently installed the latest version of the crate uint, and noticed that the code has become deprecated. I encountered the following error:
the trait bound U256: From<[u8; 32]> is not satisfied
To resolve the issue, I had to change the method from to from_big_endian. However, I'm unsure whether big-endian or little-endian is the correct choice in this context. For now, I've reverted to version 0.9.5 of the crate to avoid the issue, but it might be useful to address this in future versions of the book.
Thank you for considering this!
// lib/src/sha256.rsimplHash{pubfnhash<T: serde::Serialize>(data:&T) -> Self{letmut serialized:Vec<u8> = vec![];ifletErr(e) = ciborium::into_writer(data,&mut serialized){panic!("Failed to serialize data: {:?}. \ This should not happen.",
e
)}let hash = digest(&serialized);let hash_bytes = hex::decode(hash).unwrap();let hash_array:[u8;32] = hash_bytes.as_slice().try_into().unwrap();Hash(U256::from_big_endian(&hash_array))}
The text was updated successfully, but these errors were encountered:
I recently installed the latest version of the crate
uint
, and noticed that the code has become deprecated. I encountered the following error:To resolve the issue, I had to change the method
from
tofrom_big_endian
. However, I'm unsure whether big-endian or little-endian is the correct choice in this context. For now, I've reverted to version0.9.5
of the crate to avoid the issue, but it might be useful to address this in future versions of the book.Thank you for considering this!
The text was updated successfully, but these errors were encountered: