Encoder avec VarInt

Encode l'entrée avec “VarInt” selon la norme correspondante.

Entrée: TexteRésultat: Octets binaires

Saisie de texte

Exécuter pour voir le résultat

Exemples

A small field value

Entrée

1

Expected answer

Hexadecimal bytes
OffsetHex bytesASCII
0000000001.
A 7-bit boundary

Entrée

127

Expected answer

UTF-8 text · exact bytes

The first two-byte value

Entrée

128

Expected answer

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

Entrée

150

Expected answer

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

Entrée

300

Expected answer

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

Entrée

16384

Expected answer

Hexadecimal bytes
OffsetHex bytesASCII
0000000080 80 01...

Outils associés

Réseau

Référence de l’opération

Voir la documentation technique originale (English)