Description
Return octet = tagClass*64+(constructed ? 32 : 0)+tagNumber.
ASN.1 BER encodes values as identifiers, lengths and content; DER constrains representation to a canonical form. Content octets, first-tag octets and length prefixes are only parts of a complete encoded value.
Return octet = tagClass*64+(constructed ? 32 : 0)+tagNumber.
When to use this tool
Use BER Tag First Octet From Fields when inspecting one explicit ASN.1 encoding component.
How to use the tool and how it works
- Enter tagClass, constructed, tagNumber. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read octet. Use the output convention below.
Require whole tagClass in [0,3] and tagNumber in [0,31]. Return octet = tagClass*64+(constructed ? 32 : 0)+tagNumber.1
ASN.1 encodings distinguish identifier, length and content octets. DER adds canonical constraints; the local output still needs its surrounding encoding.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| tagClass | Tag Class | Required. Safe integer; minimum 0; maximum 3. |
| constructed | Constructed | Required. Boolean. |
| tagNumber | First-octet low field; 31 denotes high-tag-number form requiring following octets. | Required. Safe integer; minimum 0; maximum 31. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| octet | Octet | Required. Safe integer. |
{
"input": {
"tagClass": 0,
"constructed": true,
"tagNumber": 16
},
"output": {
"octet": 48
}
} Limitations and assumptions
- At tagNumber 31 the byte is a high-tag-number marker and needs following tag-number octets. Class labels, complete tags, lengths and content are not inferred.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use an appropriate complete ASN.1 encoder and schema for canonical full values, nested lengths and application semantics.
References
-
Calculation and input contract: encode/ber-tag-first-octet-from-fields — tool.io
-
ASN.1 encoding rules: ITU-T X.690 (12/1997) — International Telecommunication Union
Similar or alternative tools
- Encoding: Ber Short Length Octet
Return octet = length for BER's short definite-length form.
- Protocol Buffers Fixed32 Octet Fields Tool
Compute protocol buffers fixed32 octet fields from explicit bounded inputs.