getPadding Returns the padding required to make the length a multiple of 4.
(packetLen int)
| 5 | |
| 6 | // getPadding Returns the padding required to make the length a multiple of 4. |
| 7 | func getPadding(packetLen int) int { |
| 8 | if packetLen%4 == 0 { |
| 9 | return 0 |
| 10 | } |
| 11 | |
| 12 | return 4 - (packetLen % 4) |
| 13 | } |
| 14 | |
| 15 | // setNBitsOfUint16 will truncate the value to size, left-shift to startIndex position and set. |
| 16 | func setNBitsOfUint16(src, size, startIndex, val uint16) (uint16, error) { |
no outgoing calls
searching dependent graphs…