We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa9bcc5 commit a18ea4bCopy full SHA for a18ea4b
graph/src/util/ethereum.rs
@@ -5,8 +5,7 @@ use tiny_keccak::Keccak;
5
/// Hashes a string to a H256 hash.
6
pub fn string_to_h256(s: &str) -> H256 {
7
let mut result = [0u8; 32];
8
- let ss = &s.replace(" ", "")[..];
9
- let data: Vec<u8> = From::from(s);
+ let data = s.replace(" ", "").into_bytes();
10
let mut sponge = Keccak::new_keccak256();
11
sponge.update(&data);
12
sponge.finalize(&mut result);
0 commit comments