-
Notifications
You must be signed in to change notification settings - Fork 309
Open
Description
package main
import (
"fmt"
"strconv"
)
// Hex2bin hex2bin()
func Hex2bin(data string) (string, error) {
i, err := strconv.ParseInt(data, 16, 0)
if err != nil {
return "", err
}
return strconv.FormatInt(i, 2), nil
}
func main(){
fmt.Println(Hex2bin("48656c6c6f20576f726c6421"))
}
When I used this method, it returned an error below.
//strconv.ParseInt: parsing "48656c6c6f20576f726c6421": value out of range
If I use php function hex2bin()
:It shows us ,
Hello World!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels