Fixed off-by-one error in hash generator util