Codificar con VarInt

Codifica la entrada con “VarInt” según el estándar correspondiente.

Entrada: TextoResultado: Bytes binarios

Entrada de texto

Ejecuta para ver el resultado

Ejemplos

A small field value

Entrada

1

Expected answer

Hexadecimal bytes
OffsetHex bytesASCII
0000000001.
A 7-bit boundary

Entrada

127

Expected answer

UTF-8 text · exact bytes

The first two-byte value

Entrada

128

Expected answer

Hexadecimal bytes
OffsetHex bytesASCII
0000000080 01..
The official Protobuf example

Entrada

150

Expected answer

Hexadecimal bytes
OffsetHex bytesASCII
0000000096 01..
A counter of 300

Entrada

300

Expected answer

Hexadecimal bytes
OffsetHex bytesASCII
00000000ac 02..
A three-byte boundary

Entrada

16384

Expected answer

Hexadecimal bytes
OffsetHex bytesASCII
0000000080 80 01...

Herramientas relacionadas

Redes

Referencia de la operación

Ver la documentación técnica original (English)