Counter with Arbitrary Modulus