neuml / py27hash Goto Github PK
View Code? Open in Web Editor NEWPython 2.7 hashing and iteration in Python 3+
License: MIT License
Python 2.7 hashing and iteration in Python 3+
License: MIT License
Hash of integer long in python2 and python3 has different result. Must implement hash of long
Example:
Python2
hash(10000000000) # 10000000000
hash(-10000000000) # -1410065410
hash(20000000000) # 1474836476
hash(-20000000000) # 1474836476
hash(10 ** 20) # -824746446
Python3
hash(10000000000) # 10000000000
hash(-10000000000) # -10000000000
hash(20000000000) # 20000000000
hash(-20000000000) # -20000000000
hash(10 ** 20) # 848750603811160107
Fix this issue:
coveralls.exception.CoverallsException: Could not submit coverage: 422 Client Error: Unprocessable Entity for url: https://coveralls.io/api/v1/jobs
resubmitting with id None
Set SKIPSLOW as an empty env parameter so all tests are run via GitHub actions script.
Steps to reproduce
from py27hash.set import Set
s1 = Set([2, 3, 4, 5, 8]) # init using list
s2 = Set({2, 3, 4, 5, 8}) # init using set
print(list(s1), list(s2)) # order should be same, but it's not
Add GitHub action builds for windows, macos and 32-bit Python
https://github.com/neuml/py27hash/blob/master/src/python/py27hash/hash.py#L144
for c in value:
x = (1000003 * x) ^ Hash.ordinal(c)
x can become very large and is only truncated back to 64 bits after the entire string is hashed
There is no reason full precision must be maintained for the entire loop. It can be truncated back to 64 bits after eatch iteration
The readme says that "Python 2.7 and 3+ are supported." But the setup.py
contains the call open("README.md", "r", encoding="utf-8")
, where the encoding
keyword is not supported by the Python 2.7 open()
function.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.