0

I'm studying through my noted right and it's explaining the hash function key mod N. It also says that we may need to transform a key into a numeric represention so we can use said function. Can someone explain this to me?

Amon
  • 2,725
  • 5
  • 30
  • 52
  • In order to calculate *anything* `mod N` it first has to be a number. Can you please elaborate on what your question really is? If necessary, can you elaborate on what the "noted right" says about this? – Lasse V. Karlsen Mar 14 '14 at 21:49
  • Sorry, what I'm wondering is *how* does one convert say a key that's a string to a number? So we can then use that number in our hash function? – Amon Mar 14 '14 at 21:53
  • For example my proff was explaining the mid-square method of resolving collisions. He said that we need to square the numerical representation of a key first. He used the example "mozart" and converted that to 14 somehow – Amon Mar 14 '14 at 21:56
  • you might want to look at [this SO post](http://stackoverflow.com/questions/16008670/python-how-to-hash-a-string-into-8-digits) – violet313 Mar 14 '14 at 22:18

0 Answers0