Module Http.Digits

HTTP digits.

These represent non-negative integers. The module handles overflows.

val decode : string -> (int, string) Stdlib.result

decode s is the non-empty sequence of decimal digits s as a non-negative integer.

val encode : int -> string

encode_digits n is the non-negative integer n as a sequence of decimal digits.

  • raises Invalid_argument

    if n is negative.