//菜农HotPower[url=home.php?mod=space&uid=516618]@163.com[/url] 2019.6.21于西安雁塔菜地
func inttohex(val, size int) string { //size必须int
fmts := "%0" + strconv.Itoa(size) + "X"//%#输出0X1234
return fmt.Sprintf(fmts, val)
}
func hextoint(str string, size int) int {
var result int = 0
fmts := "%0" + strconv.Itoa(size) + "X" //%#输入0X1234
fmt.Sscanf(str, fmts, &result)
|