decimal package:text

Read a decimal integer. The input must begin with at least one decimal digit, and is consumed until a non-digit or end of string is reached. This function does not handle leading sign characters. If you need to handle signed input, use signed decimal. Note: For fixed-width integer types, this function does not attempt to detect overflow, so a sufficiently long input may give incorrect results. If you are worried about overflow, use Integer for your result type.
Read a hexadecimal integer, consisting of an optional leading "0x" followed by at least one hexadecimal digit. Input is consumed until a non-hex-digit or end of string is reached. This function is case insensitive. This function does not handle leading sign characters. If you need to handle signed input, use signed hexadecimal. Note: For fixed-width integer types, this function does not attempt to detect overflow, so a sufficiently long input may give incorrect results. If you are worried about overflow, use Integer for your result type.