add inline
This commit is contained in:
@@ -69,14 +69,17 @@ fn make_btc_address(public_key: &PublicKey) -> String {
|
|||||||
bs58::encode(&btc_addr).into_string()
|
bs58::encode(&btc_addr).into_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn calc_sha256(i: &[u8]) -> Vec<u8> {
|
fn calc_sha256(i: &[u8]) -> Vec<u8> {
|
||||||
calc_hash(Sha256::default(), i)
|
calc_hash(Sha256::default(), i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn calc_ripemd160(i: &[u8]) -> Vec<u8> {
|
fn calc_ripemd160(i: &[u8]) -> Vec<u8> {
|
||||||
calc_hash(Ripemd160::default(), i)
|
calc_hash(Ripemd160::default(), i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn calc_hash<T>(mut hasher: T, i: &[u8]) -> Vec<u8> where T: Input + FixedOutput {
|
fn calc_hash<T>(mut hasher: T, i: &[u8]) -> Vec<u8> where T: Input + FixedOutput {
|
||||||
hasher.input(&i);
|
hasher.input(&i);
|
||||||
hasher.fixed_result().to_vec()
|
hasher.fixed_result().to_vec()
|
||||||
|
|||||||
Reference in New Issue
Block a user