Let's say I have a string with the value of 4ADDF6C259EBAFF8
.
Using this I want to get a timestamp, using the formula (hex(val) >> 25) + 1008000400
.
Using t he encoding/hex
package, I have come up with the following:
srcBytes := []byte(src)
dst := make([]byte, hex.EncodedLen(len(srcBytes)))
hex.Encode(dst, srcBytes)
After this, I need a way to bit shift dst
25 times, and then add a constant to it.
However dst
is of type []byte
.
I need it to be of type hex
so I can bit shift after. How do I convert []byte
so that it can be shifted?