Commit b15e03ac authored by obscuren's avatar obscuren

Fixed issue with casting to smaller byte array

parent e0b6a316
......@@ -49,6 +49,10 @@ func BigD(data []byte) *big.Int {
func BigToBytes(num *big.Int, base int) []byte {
ret := make([]byte, base/8)
if len(num.Bytes()) > base/8 {
return num.Bytes()
}
return append(ret[:len(ret)-len(num.Bytes())], num.Bytes()...)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment