Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Hash function
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Radix conversion hashing === Analogous to the way an ASCII or [[EBCDIC]] character string representing a decimal number is converted to a numeric quantity for computing, a variable-length string can be converted as {{math|''x''<sub>''k''−1</sub>a<sup>''k''β1</sup> + ''x''<sub>''k''−2</sub>a<sup>''k''β2</sup> + ⋯ + ''x''<sub>1</sub>''a'' + ''x''<sub>0</sub>}}. This is simply a polynomial in a [[radix]] {{math|1=''a'' > 1}} that takes the components {{math|(''x''<sub>0</sub>,''x''<sub>1</sub>,...,''x''<sub>''k''β1</sub>)}} as the characters of the input string of length {{math|''k''}}. It can be used directly as the hash code, or a hash function applied to it to map the potentially large value to the hash table size. The value of {{math|''a''}} is usually a prime number large enough to hold the number of different characters in the character set of potential keys. Radix conversion hashing of strings minimizes the number of collisions.<ref>{{cite conference |last1=Ramakrishna |first1=M. V. |last2=Zobel |first2=Justin |date=1997 |url=https://citeseer.ist.psu.edu/viewdoc/download?doi=10.1.1.18.7520&rep=rep1&type=pdf |title=Performance in Practice of String Hashing Functions |book-title=Database Systems for Advanced Applications '97 |conference=DASFAA 1997 |pages=215β224 |citeseerx=10.1.1.18.7520 |doi=10.1142/9789812819536_0023 |isbn=981-02-3107-5 |s2cid=8250194 |access-date=2021-12-06}}</ref> Available data sizes may restrict the maximum length of string that can be hashed with this method. For example, a 128-bit word will hash only a 26-character alphabetic string (ignoring case) with a radix of 29; a printable ASCII string is limited to 9 characters using radix 97 and a 64-bit word. However, alphabetic keys are usually of modest length, because keys must be stored in the hash table. Numeric character strings are usually not a problem; 64 bits can count up to {{math|10<sup>19</sup>}}, or 19 decimal digits with radix 10.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)