Content deleted Content added
add →Notes |
m →Hash function used: {{pre}} |
||
(2 intermediate revisions by the same user not shown) | |||
Line 72:
We can then compute the hash of the next substring, "bra", from the hash of "abr" by subtracting the number added for the first 'a' of "abr", i.e. 97 × 256<sup>2</sup>, multiplying by the base and adding for the last a of "bra", i.e. 97 × 256<sup>0</sup>. Like so:
{{pre|style=font-size:95%|1=
}}
If we are matching the search string "bra", using similar calculation of hash("abr"),
Line 108:
==Notes==
{{notelist|refs=
{{efn|name=mod|
{{efn|name=ua|1=(-ve avoider) = "underflow avoider". Necessary if using unsigned integers for calculations. Because we know all hashes <math>h \leq p</math> for prime modulus
{{efn|name=times256|the last
{{efn|name=mod101|although {{code|((256%101)*256)%101}} is the same as 256<sup>2</sup>
}}
|