use uhash_types::{Challenge, Difficulty};
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
pub fn build_input(header: &[u8], nonce: u64) -> Vec<u8> {
let mut input = Vec::with_capacity(header.len() + 8);
input.extend_from_slice(header);
input.extend_from_slice(&nonce.to_le_bytes());
input
}
pub fn challenge_input(challenge: &Challenge, nonce: u64) -> Vec<u8> {
build_input(&challenge.header, nonce)
}
pub fn encode_difficulty(bits: u32) -> Difficulty {
Difficulty::new(bits)
}