fix hash/token generation 0/1 offset issue