pub fn generate_byte_slice_tree<E: Element, A: Algorithm<E>>(leaves: usize) -> Vec<u8> {
    let mut a = A::default();
    let mut a2 = A::default();

    let dataset: Vec<u8> = generate_vector_of_usizes(leaves)
        .iter()
        .map(|x| {
            a.reset();
            x.hash(&mut a);
            a.hash()
        })
        .take(leaves)
        .map(|item| {
            a2.reset();
            a2.leaf(item).as_ref().to_vec()
        })
        .flatten()
        .collect();

    dataset
}
// generate dataset of hashable (usize) elements and serialize it at once
generate dataset of hashable (usize) elements and serialize it at once
generate dataset of hashable ( usize ) elements and serialize it at once
pub fn generate_byte_slice_tree<E: Element, A: Algorithm<E>>(leaves: usize) -> Vec<u8> {
    let mut a = A::default();
    let mut a2 = A::default();
    let dataset: Vec<u8> = generate_vector_of_usizes(leaves)
        .iter()
        .map(|x| {
            a.reset();
            x.hash(&mut a);
            a.hash()
        })
        .take(leaves)
        .map(|item| {
            a2.reset();
            a2.leaf(item).as_ref().to_vec()
        })
        .flatten()
        .collect();
    dataset
}
pub fn generate_byte_slice_tree < E : Element , A : Algorithm < E > > ( leaves : usize ) -> Vec < u8 > { let mut a = A :: default ( ) ; let mut a2 = A :: default ( ) ; let dataset : Vec < u8 > = generate_vector_of_usizes ( leaves ) . iter ( ) . map ( | x | { a . reset ( ) ; x . hash ( & mut a ) ; a . hash ( ) } ) . take ( leaves ) . map ( | item | { a2 . reset ( ) ; a2 . leaf ( item ) . as_ref ( ) . to_vec ( ) } ) . flatten ( ) . collect ( ) ; dataset }
generate dataset of hashable (usize) elements and serialize it at once
generate dataset of hashable ( usize ) elements and serialize it at once
leaves
usize