mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	hashlib: don't xorshift in between upper and lower word
This commit is contained in:
		
							parent
							
								
									209ab6fb72
								
							
						
					
					
						commit
						c1af19fabc
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -99,17 +99,18 @@ class Hasher {
 | 
			
		|||
	[[nodiscard]]
 | 
			
		||||
	static uint32_t mkhash(uint32_t a, uint32_t b) {
 | 
			
		||||
		uint32_t hash = ((a << 5) + a) ^ b;
 | 
			
		||||
		hash = mkhash_xorshift(fudge ^ hash);
 | 
			
		||||
		return hash;
 | 
			
		||||
	}
 | 
			
		||||
	public:
 | 
			
		||||
	void hash32(uint32_t i) {
 | 
			
		||||
		state = mkhash(i, state);
 | 
			
		||||
		state = mkhash_xorshift(fudge ^ state);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	void hash64(uint64_t i) {
 | 
			
		||||
		state = mkhash((uint32_t)(i % (1ULL << 32ULL)), state);
 | 
			
		||||
		state = mkhash((uint32_t)(i >> 32ULL), state);
 | 
			
		||||
		state = mkhash_xorshift(fudge ^ state);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	[[nodiscard]]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue