DecodeNonsortingStdlibVarint decodes a value encoded by EncodeNonsortingVarint. It returns the length of the encoded varint and value.
(b []byte)
| 1709 | // DecodeNonsortingStdlibVarint decodes a value encoded by EncodeNonsortingVarint. It |
| 1710 | // returns the length of the encoded varint and value. |
| 1711 | func DecodeNonsortingStdlibVarint(b []byte) (remaining []byte, length int, value int64, err error) { |
| 1712 | value, length = binary.Varint(b) |
| 1713 | if length <= 0 { |
| 1714 | return nil, 0, 0, fmt.Errorf("int64 varint decoding failed: %d", length) |
| 1715 | } |
| 1716 | return b[length:], length, value, nil |
| 1717 | } |
| 1718 | |
| 1719 | // NonsortingUvarintMaxLen is the maximum length of an EncodeNonsortingUvarint |
| 1720 | // encoded value. |
no outgoing calls
no test coverage detected
searching dependent graphs…