bithash function, fix to random number generator (seeding)