<div dir="ltr">I actually have been poking around that code already. I also found <a href="https://github.com/vperron/python-superfasthash/blob/master/superfasthash.py">https://github.com/vperron/python-superfasthash/blob/master/superfasthash.py</a> in case of interest.<div><br></div><div>But it still seems like library authors with this use case should keep their library code free of implementation details like this, and instead use a higher-level API provided by Python.</div><div><br></div><div>Thanks,<br>Josh<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 27, 2016 at 10:28 PM, Ryan Gonzalez <span dir="ltr"><<a href="mailto:rymg19@gmail.com" target="_blank">rymg19@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">You could always try to make a Python version of the C tuple hashing function[1] (requires the total # of elements) or PyPy's[2] (seems like it would allow true incremental hashing). API idea:<div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">hasher = IncrementalHasher()</div><div dir="auto">hasher.add(one_item_to_hash)  # updates hasher.hash property with result</div><div dir="auto"># repeat</div><div dir="auto">return hasher.hash</div><div dir="auto"><br></div><div dir="auto"><div dir="auto"><br></div><div dir="auto">[1]: <a href="https://hg.python.org/cpython/file/dcced3bd22fe/Objects/tupleobject.c#l331" target="_blank">https://hg.python.org/<wbr>cpython/file/dcced3bd22fe/<wbr>Objects/tupleobject.c#l331</a><br>[2]: <a href="https://bitbucket.org/pypy/pypy/src/d8febc18447e1f785a384d52413a345d7b3db423/rpython/rlib/objectmodel.py#objectmodel.py-562" target="_blank">https://bitbucket.org/<wbr>pypy/pypy/src/<wbr>d8febc18447e1f785a384d52413a34<wbr>5d7b3db423/rpython/rlib/<wbr>objectmodel.py#objectmodel.py-<wbr>562</a><br><br><div dir="auto">--<br>Ryan (ライアン)<br>Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else<br><a href="http://kirbyfan64.github.io/" target="_blank">http://kirbyfan64.github.io/</a></div></div></div></div></blockquote></div><br></div></div></div>