getData returns a slice from the data based on the start and size and pads up to size with zero's. This function is overflow safe.
(data []byte, start uint64, size uint64)
| 35 | // getData returns a slice from the data based on the start and size and pads |
| 36 | // up to size with zero's. This function is overflow safe. |
| 37 | func getData(data []byte, start uint64, size uint64) []byte { |
| 38 | length := uint64(len(data)) |
| 39 | if start > length { |
| 40 | start = length |
| 41 | } |
| 42 | end := start + size |
| 43 | if end > length { |
| 44 | end = length |
| 45 | } |
| 46 | return common.RightPadBytes(data[start:end], int(size)) |
| 47 | } |
| 48 | |
| 49 | // getDataBig returns a slice from the data based on the start and size and pads |
| 50 | // up to size with zero's. This function is overflow safe. |
no outgoing calls
no test coverage detected