MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / hash_message

Function hash_message

utils/src/crypto.rs:239–242  ·  view source on GitHub ↗

Helper function to hash bytes and convert to a Message

(message: &[u8])

Source from the content-addressed store, hash-verified

237
238// Helper function to hash bytes and convert to a Message
239pub fn hash_message(message: &[u8]) -> Result<Message> {
240 let hashed = hash(message);
241 Message::from_slice(&hashed).map_err(|e| UtilsError::CreateMessage(e.to_string()))
242}
243
244/// Encode items in a RlpStream
245///

Callers 4

signFunction · 0.85
sign_recoveryFunction · 0.85
verifyFunction · 0.85
recover_public_keyFunction · 0.85

Calls 1

hashFunction · 0.85

Tested by

no test coverage detected