(rng: &mut R)
| 803 | } |
| 804 | |
| 805 | pub fn gen_rand_preimage_hex<R: Rng + CryptoRng>(rng: &mut R) -> String { |
| 806 | let mut pre = [0u8; 32]; |
| 807 | rng.fill_bytes(&mut pre); |
| 808 | hex::encode(&pre) |
| 809 | } |
| 810 | |
| 811 | pub fn payment_hash(preimage: &[u8]) -> sha256::Hash { |
| 812 | sha256::Hash::hash(preimage) |
no test coverage detected