Update generic_array
Warning: this may have performance implications.
This commit is contained in:
		
				
					committed by
					
						
						Greg Fitzgerald
					
				
			
			
				
	
			
			
			
						parent
						
							1c97bf50b6
						
					
				
				
					commit
					410272ee1d
				
			@@ -53,7 +53,7 @@ erasure = []
 | 
				
			|||||||
[dependencies]
 | 
					[dependencies]
 | 
				
			||||||
rayon = "1.0.0"
 | 
					rayon = "1.0.0"
 | 
				
			||||||
sha2 = "0.7.0"
 | 
					sha2 = "0.7.0"
 | 
				
			||||||
generic-array = { version = "0.9.0", default-features = false, features = ["serde"] }
 | 
					generic-array = { version = "0.11.1", default-features = false, features = ["serde"] }
 | 
				
			||||||
serde = "1.0.27"
 | 
					serde = "1.0.27"
 | 
				
			||||||
serde_derive = "1.0.27"
 | 
					serde_derive = "1.0.27"
 | 
				
			||||||
serde_json = "1.0.10"
 | 
					serde_json = "1.0.10"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,10 @@ pub type Hash = GenericArray<u8, U32>;
 | 
				
			|||||||
pub fn hash(val: &[u8]) -> Hash {
 | 
					pub fn hash(val: &[u8]) -> Hash {
 | 
				
			||||||
    let mut hasher = Sha256::default();
 | 
					    let mut hasher = Sha256::default();
 | 
				
			||||||
    hasher.input(val);
 | 
					    hasher.input(val);
 | 
				
			||||||
    hasher.result()
 | 
					
 | 
				
			||||||
 | 
					    // At the time of this writing, the sha2 library is stuck on an old version
 | 
				
			||||||
 | 
					    // of generic_array (0.9.0). Decouple ourselves with a clone to our version.
 | 
				
			||||||
 | 
					    GenericArray::clone_from_slice(hasher.result().as_slice())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// Return the hash of the given hash extended with the given value.
 | 
					/// Return the hash of the given hash extended with the given value.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user