add hash file code, update unit tests