strconv.go 476 B

12345678910111213141516171819
  1. package util
  2. import "strconv"
  3. func Atoi(b []byte) (int, error) {
  4. return strconv.Atoi(BytesToString(b))
  5. }
  6. func ParseInt(b []byte, base int, bitSize int) (int64, error) {
  7. return strconv.ParseInt(BytesToString(b), base, bitSize)
  8. }
  9. func ParseUint(b []byte, base int, bitSize int) (uint64, error) {
  10. return strconv.ParseUint(BytesToString(b), base, bitSize)
  11. }
  12. func ParseFloat(b []byte, bitSize int) (float64, error) {
  13. return strconv.ParseFloat(BytesToString(b), bitSize)
  14. }