You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
476 B

  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. }