AppendUint32 appends v to dst using little endian binary encoding using at most byteCount bytes.
(dst []byte, v uint32, byteCount uint8)
| 102 | |
| 103 | // AppendUint32 appends v to dst using little endian binary encoding using at most byteCount bytes. |
| 104 | func AppendUint32(dst []byte, v uint32, byteCount uint8) []byte { |
| 105 | switch byteCount { |
| 106 | case 0, 1, 2: |
| 107 | return AppendUint16(dst, uint16(v), byteCount) |
| 108 | case 3: |
| 109 | return append(dst, byte(v), byte(v>>8), byte(v>>16)) |
| 110 | default: |
| 111 | dst = append(dst, byte(v), byte(v>>8), byte(v>>16), byte(v>>24)) |
| 112 | for i := uint8(4); i < byteCount; i++ { |
| 113 | dst = append(dst, 0) |
| 114 | } |
| 115 | return dst |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | // AppendUint64 appends v to dst using little endian binary encoding using at most byteCount bytes. |
| 120 | func AppendUint64(dst []byte, v uint64, byteCount uint8) []byte { |
no test coverage detected