fixed a bug of hash generator