Skip to main content
Version: v0.0.3

Function: decodeD0Header()

decodeD0Header(raw): TelecomHeader

Decode the fixed-length D.0 Transaction Header from the head of a raw message. The caller guarantees raw.length >= D0_HEADER_LENGTH. Each positional field is sliced and trimmed of pad whitespace.

Parameters

raw

string

The raw message text (length already validated by the caller).

Returns

TelecomHeader

A frozen TelecomHeader.

Example

const h = decodeD0Header("610279D0B1".padEnd(56, " "));
h.binNumber; // "610279"
h.transactionCode; // "B1"