String Hashing Using Random Number Generator for Collision Resistance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Common hash functions experience high probabilities of collisions due to uneven distribution of hash values, leading to inefficiencies in hash table operations and data comparison tasks.
Innovation Solution
A string hashing method utilizing a pseudo-random number generator (PRNG) that processes input streams in overlapping subsets of bits, entangling each subset with a PRNG state and accumulating the results to produce a collision-resistant hash value, with optional derangement or augmentation steps to prevent zero-length input collisions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If common hash functions are used, then the hashing process is simple and fast, but the distribution of hash values is uneven leading to high collision probability
Solution Approach 1:
The input string is divided into multiple substrings of equal length. Each substring is processed separately by the PRNG-based hashing function, and the results are combined through addition modulo 2^32. This segmentation allows the system to handle long strings efficiently while maintaining uniform distribution and low collision probability.
Solution Approach 2:
A pseudo-random number generator (PRNG) is introduced as an intermediary component between the input string and the final hash value. The PRNG transforms each substring through multiple mixing operations (rotation, XOR, addition) to produce intermediate hash values that are then combined. This intermediary layer ensures uniform distribution without requiring complex cryptographic functions.
2Adaptability or versatility
If the input string length varies, then the hashing function must handle variable lengths, but this increases the probability of collisions for similar strings
Solution Approach 1:
The variable-length input string is segmented into fixed-length substrings. Each substring is processed independently through the same PRNG-based hashing sequence, ensuring that strings of any length are transformed using consistent operations. This approach maintains adaptability to variable lengths while preventing collision patterns that arise from length-dependent hashing.
Solution Approach 2:
The hashing function processes each character position within substrings independently through multiple PRNG mixing rounds, effectively adding dimensional processing. Characters at the same position across different substrings are all transformed through the same sequence of operations, creating a multi-dimensional transformation space that reduces collisions for similar strings of varying lengths.
Data Source
AI summary
String hashing using a random number generator is disclosed. A method of implementations includes dividing an input stream provided to a hashing module into a plurality of subsets of bits, wherein each subset comprises a same number of bits and wherein each of the subsets of bits comprises an overlapping subset, augmenting a subset of the subsets of bits with a constant, entangling, by a mixer of the hashing module, the subset by an output of a number generator, adding a result of the entangling to an accumulator of the hashing module, repeating the augmenting, the entangling, and the adding on at least a portion of a next sequential subset of the subset of bits, and when all of the subsets of bits have been processed, returning a value in the accumulator as a hash result value.


