Function vec_to_array32

Source
pub fn vec_to_array32(vec: Vec<u8>) -> Result<[u8; 32], TypeError>
Expand description

Converts a vector of bytes into an array of 32 bytes. Returns an error if the vector is not exactly 32 bytes long.

ยงExamples

use neo3::neo_types::vec_to_array32;
let vec = vec![0_u8; 32];
let array = vec_to_array32(vec).unwrap();
assert_eq!(array.len(), 32);