MCPcopy Create free account
hub / github.com/pion/rtcp / getPadding

Function getPadding

util.go:7–13  ·  view source on GitHub ↗

getPadding Returns the padding required to make the length a multiple of 4.

(packetLen int)

Source from the content-addressed store, hash-verified

5
6// getPadding Returns the padding required to make the length a multiple of 4.
7func 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.
16func setNBitsOfUint16(src, size, startIndex, val uint16) (uint16, error) {

Callers 6

TestGetPaddingFunction · 0.85
MarshalMethod · 0.85
lenMethod · 0.85
HeaderMethod · 0.85
UnmarshalMethod · 0.85
MarshalSizeMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestGetPaddingFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…