astro.Function.encodeSystemAddress - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / astro / encodeSystemAddress

Function: encodeSystemAddress()

encodeSystemAddress(parts, origin): bigint

Defined in: src/astro/system-address.ts:354

Encode system-name parts and a resolved region origin into a system address.

Parameters

parts

SystemNameParts

The parsed system-name parts, as parseSystemName returns (letters and mass code are zero-based numeric indices, not characters).

origin

NamingRegionOrigin

The region origin (internal units), from resolveNamingRegionOrigin in ./naming-region-origins.

Returns

bigint

The 64-bit system address.

Throws

If the mass code is outside 0–7, a letter is outside 0–25, n1 is not one the boxel packer accepts, the origin has a negative coordinate, the name's boxel code or sector falls outside the address layout, or the sequence does not fit its size-class-dependent field.

Example

import { resolveNamingRegionOrigin } from '@elite-dangerous-almanac/core/astro/naming-region-origins';
import { encodeSystemAddress } from '@elite-dangerous-almanac/core/astro/system-address';
import { parseSystemName } from '@elite-dangerous-almanac/core/astro/system-name';

const parts = parseSystemName('Synuefe EN-H d11-96')!;
encodeSystemAddress(parts, resolveNamingRegionOrigin(parts.regionName)!); // -> 3309179996515n
⚠️ **GitHub.com Fallback** ⚠️