Integers are represented by an 'i' followed by the number in base 10 followed by an 'e'. For example i3e corresponds to 3 and i-3e corresponds to -3. Integers have no size limitation. i-0e is invalid. All encodings with a leading zero, such as i03e, are invalid, other than i0e, which of course corresponds to 0.
This PR makes sure leading 0s as well as -0 are not accepted.
While this is not specified, the same thing was done for strings to ensure isomorphism between encoder/decoder.
Whitespaces are also not specified in the specs so for the same reason I removed support for them.
The spec notes:
This PR makes sure leading 0s as well as -0 are not accepted.
While this is not specified, the same thing was done for strings to ensure isomorphism between encoder/decoder. Whitespaces are also not specified in the specs so for the same reason I removed support for them.
Related to https://github.com/rgrinberg/bencode/issues/15#issuecomment-2075448486