verify_chunk

Function verify_chunk 

Source
pub fn verify_chunk(name: &XorName, bytes: &[u8]) -> Result<EncryptedChunk>
Expand description

Verifies and deserializes a chunk by checking its content hash matches the provided name.

§Arguments

  • name - The expected XorName hash of the chunk content
  • bytes - The serialized chunk content to verify

§Returns

  • Result<EncryptedChunk> - The deserialized chunk if verification succeeds
  • Error - If the content hash doesn’t match or deserialization fails