Method and apparatus to scale and unroll an incremental hash function
First Claim
1. A method of performing an incremental hash function on a data string, the method comprising:
- using a processor to perform at least a portion of one or more of the following acts;
receiving the data string over a network at a network interface device, the data string including a plurality of data samples B0 to BI, wherein represents a number of data samples that are received in parallel;
defining a moving window of length wl within the data string;
as the plurality of data samples are received, calculating and maintaining a corresponding plurality of hash values H0 to HI, one hash value for each data sample that can be received in parallel;
wherein calculating the plurality of hash values includes;
defining a hash multiplier constant to be k;
calculating a first hash value H0 by adding a first data sample B0 to a last hash value HI, and by subtracting a data sample that was received wl bytes previously multiplied by kwl;
calculating a second hash value H1 by adding the first data sample B0 multiplied by k and a second data sample B1 to the last hash value HI, by subtracting the data sample that was received wl bytes previously multiplied by kwl+1, and by subtracting a data sample received wl+1 bytes previously multiplied by kwl;
calculating the last hash value HIby adding the correspondingly multiplied values of the first data samples to the last hash value HI, and by subtracting the correspondingly multiplied values of bytes received from wl to wl+previously;
combining the calculated first hash value through last hash value into a result;
using the result to identify content in the form of a particular reference string; and
performing a particular action based upon the particular reference string.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus speeding up an incremental hash function is described. The method may comprise receiving a data string including a plurality of N data samples and, as each data sample is received, multiplying the data samples to obtain data sample multiplication results and multiplying a current hash value by a constant to obtain a hash multiplication result. Thereafter, the data sample multiplication results are added to the hash multiplication result to obtain new current hash values and a hash value of the data string is defined as the new hash value. In an embodiment, a moving window of length wl may be defined and data samples that were received wl to wl+N bytes previously may be multiplied with the constant raised to the power of w to wl+Nl to obtain n subtraction results.
-
Citations
7 Claims
-
1. A method of performing an incremental hash function on a data string, the method comprising:
-
using a processor to perform at least a portion of one or more of the following acts; receiving the data string over a network at a network interface device, the data string including a plurality of data samples B0 to BI, wherein represents a number of data samples that are received in parallel; defining a moving window of length wl within the data string; as the plurality of data samples are received, calculating and maintaining a corresponding plurality of hash values H0 to HI, one hash value for each data sample that can be received in parallel; wherein calculating the plurality of hash values includes; defining a hash multiplier constant to be k; calculating a first hash value H0 by adding a first data sample B0 to a last hash value HI, and by subtracting a data sample that was received wl bytes previously multiplied by kwl; calculating a second hash value H1 by adding the first data sample B0 multiplied by k and a second data sample B1 to the last hash value HI, by subtracting the data sample that was received wl bytes previously multiplied by kwl+1, and by subtracting a data sample received wl+1 bytes previously multiplied by kwl; calculating the last hash value HIby adding the correspondingly multiplied values of the first data samples to the last hash value HI, and by subtracting the correspondingly multiplied values of bytes received from wl to wl+previously; combining the calculated first hash value through last hash value into a result; using the result to identify content in the form of a particular reference string; and performing a particular action based upon the particular reference string. - View Dependent Claims (2, 3)
-
-
4. Apparatus to perform an incremental hash function on a data string, the apparatus comprising:
-
at least one processor; and a memory including instructions which, when executed, provide a modified hash function module to receive the data string including a plurality of data samples B0 to B1, wherein represents a number of data samples that are received in parallel, wherein a moving window of length wl is defined with the data string, and wherein, as the plurality of data samples are received, the modified hash function module calculates and maintains a corresponding plurality of hash values H0 to HI, one hash value for each data sample that can be received in parallel; wherein calculating the plurality of hash values includes; defining a hash multiplier constant to be k; calculating a first hash value H0 by adding a first data sample B0 to a last hash value HI, and by subtracting a data sample that was received wl bytes previously multiplied by kwl; calculating a second hash value H1 by adding the first data sample B0 multiplied by k and a second data sample B1 to the last hash value HI, by subtracting the data sample that was received wl bytes previously multiplied by kwl+1, and by subtracting a data sample received wl+1 bytes previously multiplied by kwl; calculating the last hash value HI by adding the correspondingly multiplied values of the first data samples to the last hash value HI, and by subtracting the correspondingly multiplied values of bytes received from wl to wl+previously; combining the calculated first hash value through last hash value into a result; using the result to identify content in the form of a particular reference string; and performing a particular action based upon the particular reference string. - View Dependent Claims (5)
-
-
6. Apparatus to perform an incremental hash function on a data string, the apparatus comprising:
-
at least one processor; and memory including instructions which, when executed, provide modified hash function means to receive the data string including a plurality of data samples B0 to BI, wherein represents a number of data samples that are received in parallel, wherein a moving window of length wl is defined with the data string, and wherein, as the plurality of data samples are received, the modified hash function means calculates and maintains a corresponding plurality of hash values H0 to HI, one hash value for each data sample that can be received in parallel; wherein calculating the plurality of hash values includes; defining a hash multiplier constant to be k; calculating a first hash value H0 by adding a first data sample B0 to a last hash value HI, and by subtracting a data sample that was received wl bytes previously multiplied by kwl; calculating a second hash value H1 by adding the first data sample B0 multiplied by k and a second data sample B1 to the last hash value HI, by subtracting the data sample that was received wl bytes previously multiplied by kwl+1, and by subtracting a data sample received wl+1 bytes previously multiplied by kwl; calculating the last hash value HI by adding the correspondingly multiplied values of the first data samples to the last hash value HI, and by subtracting the correspondingly multiplied values of bytes received from wl to wl+previously; combining the calculated first hash value through last hash value into a result; using the result to identify content in the form of a particular reference string; and performing a particular action based upon the particular reference string. - View Dependent Claims (7)
-
Specification