Skip to content

Conversation

Asa0oo0o0o
Copy link
Contributor

@Asa0oo0o0o Asa0oo0o0o commented Feb 11, 2025

The bitwise AND operation does not ensure that the hash value is within an appropriate range. According to the docs, a modulo operation is required here.

Implementations in some other languages ​​have the same issue.

If this pull request (PR) is associated with coding or code transpilation, please attach the relevant console outputs to the PR and complete the following checklist:

  • I have thoroughly reviewed the code, focusing on its formatting, comments, indentation, and file headers.
  • I have confirmed that the code execution outputs are consistent with those produced by the reference code (Python or Java).
  • The code is designed to be compatible on standard operating systems, including Windows, macOS, and Ubuntu.
image

Copy link
Owner

@krahets krahets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@krahets krahets added bug Bug fixes code Code-related labels Feb 24, 2025
@krahets krahets merged commit 98cd3a8 into krahets:main Feb 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes code Code-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants