Excerpt from the article:

We add the string “Elephant”, the first function gives a hash code equal to 25425, and the second 894346520. We have 16 bits in total, so we find the values ​​modulo 16. Total, the first hash 1, and the second 8. We set the corresponding bits.

The module is the same kind of abs. the value of the number ... I can not understand what and how the author calculates that out of 25425 it turns out 1 and from the number 894346520 we get the number 8?

  • 3
    The module in programming is the remainder of the division. True, why is it taken modulo 16 and how does this compare with 16 bits is a mystery to me. all the same modulo 16 is only 4 bits - Mike
  • Here is meant modular arithmetic. Read the comments to AnT's answer in this question . You can also see code examples for translating modulo numbers in this question . - wololo
  • @Mike: Yes, and in math too - VladD February
  • @Mike can clarify why 16 is 4 bits? After all, a byte is 8 bits, i.e. we can say that there are 2 bytes. But from where 4 bits? - fosh4455
  • @ fosh4455 "Value modulo 16" is usually understood as the remainder of dividing by 16. It can be from 0 to 15 inclusive. values ​​from 0 to 15 just fit in 4 bits (2 ^ 4 = 16). If it meant that you should leave the lower 16 bits of the value, then it would be correct to say "modulo 2 to the 16th degree" - Mike

0