Generate a requestId that satisfies NAV's constraints.
NAV requires the value to match [+a-zA-Z0-9_]{1,30} and to be unique for
the taxpayer across all requests ever sent — a replayed identifier is
rejected with INVALID_REQUEST_ID. The generated value combines a
millisecond timestamp with random characters, which is collision safe for
practical throughput, but persisting issued identifiers is still the only
way to be certain after a clock change.
Parameters
prefix: string = 'ON'
optional caller prefix, useful for tracing ([a-zA-Z0-9_+])
Generate a
requestIdthat satisfies NAV's constraints.NAV requires the value to match
[+a-zA-Z0-9_]{1,30}and to be unique for the taxpayer across all requests ever sent — a replayed identifier is rejected withINVALID_REQUEST_ID. The generated value combines a millisecond timestamp with random characters, which is collision safe for practical throughput, but persisting issued identifiers is still the only way to be certain after a clock change.