jam-std-common 0.1.26

Common datatypes and utilities for the JAM nodes and tooling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub mod bandersnatch;
pub mod ed25519;
pub mod hashing;
pub mod mmr;

/// Concatenate `parts` into `res`. Returns `res`.
///
/// The length of `res` must be equal to the sum of the lengths of `parts`.
fn concat<'res>(res: &'res mut [u8], parts: &[&[u8]]) -> &'res mut [u8] {
	let mut remaining = &mut *res;
	for part in parts {
		let (head, tail) = remaining.split_at_mut(part.len());
		head.copy_from_slice(part);
		remaining = tail;
	}
	assert!(remaining.is_empty());
	res
}