I want to convert from int to hex in Golang. In strconv, there is a method that converts strings to hex. Is there a similar method to get a hex string from an int?
E.g. if its uint32, you can convert it to HEX as seen below =>
var p uint32 p = 4278190335 r := p >> 24 & 0xFF g := p >> 16 & 0xFF b := p >> 8 & 0xFF fmt.Println(r, g, b)//255 0 0
DEMO
you can also check this online tool for ref. https://cryptii.com/pipes/integer-encoder