HF RL Explorer

Implement a command-line tool /app/decoder that reads a binary file in a custom TLV (Type-Length-Value)…

Implement a command-line tool /app/decoder that reads a binary file in a custom TLV (Type-Length-Value)…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Unsigned LEB128 encoding: The number is represented as a sequence of 7-bit groups, least significant group…

The task

Unsigned LEB128 encoding: The number is represented as a sequence of 7-bit groups, least significant group first. Each byte has bit 7 set to 1 except the last byte, which has bit 7 set to 0. All unused bits in the final byte must be zero (no overlong encodings for values that fit in fewer bytes).

Part of ai-and/termgrade-environments.