Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alternative hashing seed for TOnePipeShell #56

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion algorithms/tonepipeshell.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Created by Still Hsu <[email protected]>

DESCRIPTION = "TOnePipeShell hash with seed 0xC85E31"
DESCRIPTION = "TOnePipeShell hash with seed 0xC85E31 (13131313)"
TYPE = 'unsigned_int'
TEST_1 = 3454880715

Expand Down
11 changes: 11 additions & 0 deletions algorithms/tonepipeshell_alt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Created by Still Hsu <[email protected]>

DESCRIPTION = "TOnePipeShell hash with seed 0x4E44CB31 (1313131313)"
TYPE = 'unsigned_int'
TEST_1 = 3702427595

def hash(data):
out_hash = 0
for c in data:
out_hash = (c + 0x4E44CB31 * out_hash) & 0xffffffff
return out_hash
Loading