Skip to content

Commit

Permalink
Merge 4356a4d into 4b324d0
Browse files Browse the repository at this point in the history
  • Loading branch information
The-inside-man committed Jul 15, 2021
2 parents 4b324d0 + 4356a4d commit f01157a
Show file tree
Hide file tree
Showing 5 changed files with 884 additions and 99 deletions.
1 change: 1 addition & 0 deletions optimizely/helpers/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ConditionOperatorTypes(object):
AND = 'and'
OR = 'or'
NOT = 'not'
operators = [AND, OR, NOT]


class ConditionMatchTypes(object):
Expand Down
64 changes: 32 additions & 32 deletions optimizely/lib/pymmh3.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,25 @@ def fmix(k):
for block_start in xrange(0, nblocks * 8, 8):
# ??? big endian?
k1 = (
key[2 * block_start + 7] << 56
| key[2 * block_start + 6] << 48
| key[2 * block_start + 5] << 40
| key[2 * block_start + 4] << 32
| key[2 * block_start + 3] << 24
| key[2 * block_start + 2] << 16
| key[2 * block_start + 1] << 8
| key[2 * block_start + 0]
key[2 * block_start + 7] << 56 |
key[2 * block_start + 6] << 48 |
key[2 * block_start + 5] << 40 |
key[2 * block_start + 4] << 32 |
key[2 * block_start + 3] << 24 |
key[2 * block_start + 2] << 16 |
key[2 * block_start + 1] << 8 |
key[2 * block_start + 0]
)

k2 = (
key[2 * block_start + 15] << 56
| key[2 * block_start + 14] << 48
| key[2 * block_start + 13] << 40
| key[2 * block_start + 12] << 32
| key[2 * block_start + 11] << 24
| key[2 * block_start + 10] << 16
| key[2 * block_start + 9] << 8
| key[2 * block_start + 8]
key[2 * block_start + 15] << 56 |
key[2 * block_start + 14] << 48 |
key[2 * block_start + 13] << 40 |
key[2 * block_start + 12] << 32 |
key[2 * block_start + 11] << 24 |
key[2 * block_start + 10] << 16 |
key[2 * block_start + 9] << 8 |
key[2 * block_start + 8]
)

k1 = (c1 * k1) & 0xFFFFFFFFFFFFFFFF
Expand Down Expand Up @@ -258,31 +258,31 @@ def fmix(h):
# body
for block_start in xrange(0, nblocks * 16, 16):
k1 = (
key[block_start + 3] << 24
| key[block_start + 2] << 16
| key[block_start + 1] << 8
| key[block_start + 0]
key[block_start + 3] << 24 |
key[block_start + 2] << 16 |
key[block_start + 1] << 8 |
key[block_start + 0]
)

k2 = (
key[block_start + 7] << 24
| key[block_start + 6] << 16
| key[block_start + 5] << 8
| key[block_start + 4]
key[block_start + 7] << 24 |
key[block_start + 6] << 16 |
key[block_start + 5] << 8 |
key[block_start + 4]
)

k3 = (
key[block_start + 11] << 24
| key[block_start + 10] << 16
| key[block_start + 9] << 8
| key[block_start + 8]
key[block_start + 11] << 24 |
key[block_start + 10] << 16 |
key[block_start + 9] << 8 |
key[block_start + 8]
)

k4 = (
key[block_start + 15] << 24
| key[block_start + 14] << 16
| key[block_start + 13] << 8
| key[block_start + 12]
key[block_start + 15] << 24 |
key[block_start + 14] << 16 |
key[block_start + 13] << 8 |
key[block_start + 12]
)

k1 = (c1 * k1) & 0xFFFFFFFF
Expand Down
Loading

0 comments on commit f01157a

Please sign in to comment.