Uint256FromBytes converts []byte to Uint256.
(b []byte)
| 75 | |
| 76 | // Uint256FromBytes converts []byte to Uint256. |
| 77 | func Uint256FromBytes(b []byte) (*Uint256, error) { |
| 78 | if len(b) != 32 { |
| 79 | return nil, ErrBytesLen |
| 80 | } |
| 81 | i := Uint256{} |
| 82 | binary.Read(bytes.NewBuffer(b), binary.BigEndian, &i) |
| 83 | return &i, nil |
| 84 | } |