initial version from google leveldb 1.12