Skip to content

Commit

Permalink
Merge pull request #47 from jershmagersh/add-65599-multiply
Browse files Browse the repository at this point in the history
Adding algorithm for adding 65599 and multiplying the result.
  • Loading branch information
herrcore authored Oct 20, 2023
2 parents f0ef5b3 + 434b837 commit fef3215
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ HashDB relies on community support to keep our hash library current! Our goal is
DESCRIPTION = "your hash description here"
# Type can be either 'unsigned_int' (32bit) or 'unsigned_long' (64bit)
TYPE = 'unsigned_int'
# Test must match the exact has of the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
# Test must match the exact hash of the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
TEST_1 = hash_of_string_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789


Expand Down
14 changes: 14 additions & 0 deletions algorithms/add_65599.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
DESCRIPTION = "ADD 65599 and MULTIPLY"
TYPE = 'unsigned_int'
TEST_1 = 2480409887

def hash(data):
result = 0
for c in data:
tmp = c + 32
if(((c - ord('A')) & 0xFFFF) > 26):
tmp = c
result = (tmp + 0x1003F * result) & 0xFFFFFFFF

return result

0 comments on commit fef3215

Please sign in to comment.