feat: Add helper functions for field Ids

This commit is contained in:
2022-08-04 23:08:02 +02:00
parent a82b5d0990
commit b8d70f1b88
2 changed files with 12 additions and 4 deletions

View File

@@ -4,6 +4,14 @@ const lsb7Mask = 0x7F;
/// Constant for setting the MSB
const msb = 1 << 7;
/// Field types
const fieldTypeUint32 = 0;
const fieldTypeByteArray = 2;
int fieldId(int number, int type) {
return (number << 3) | type;
}
class VarintDecode {
const VarintDecode(this.n, this.length);