Author: John Whitney <jjw@deltup.org>
Modifications for 64 bit index, library-only fork: Bernd Paysan <bernd@net2o.de>