- Used to convert a hex string to a formatted ip address
- Provides information regarding request such as:
- Proper IP address
- IP address type
- Upon errors what specifically triggered
With git installed simply run
go get github.com/calebice/hexFollowing this, then be sure to include in imports
import(
"github.com/calebice/hex"
)- Takes in a requested address to be converted
- Returns an IpMessage object (detailed below)
package main
import(
"github.com/calebice/hex"
)
func main(){}
request:="AAAAAAAA"
convert:=hex.Decode(request)
IpAddress:=convert.GetIP() //Return address
IpType:=convert.GetAddrType() //Return type of address
ErrorMsg:=convert.GetErrMsg() //Return the error msg
}- address (string)
- The converted formatted IP address
- addressType (string)
- The type of IP message of the request
- errorMessage (error)
- Informational error message if the address is invalid
- GetIP() string
- Returns the address item
- GetAddrType() string
- Returns the address type
- GetErrMsg() error
- Returns error associated with conversion failure