Skip to content

Conversation

SaveTheRbtz
Copy link
Contributor

From strconv.ParseInt:

If the base argument is 0, the true base is implied by the string's prefix following the sign (if present): 2 for "0b", 8 for "0" or "0o", 16 for "0x", and 10 otherwise. Also, for argument base 0 only, underscore characters are permitted as defined by the Go syntax for integer literals.

This is useful for example for hex constants from the crypto/tls, e.g.:

VersionTLS13 = 0x0304

PS. Codepath in the MinVersion parsing looks quite fragile.
PPS. Code in Min/Max should likely be the same.

@ccojocar ccojocar merged commit dabc7dc into securego:master Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants