astro.Function.lettersToBoxelCode - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / astro / lettersToBoxelCode
lettersToBoxelCode(
l1,l2,l3,n1):number
Defined in: src/astro/system-name.ts:71
Pack a boxel's (l1, l2, l3, n1) letter code into the single base-26 index the
address format uses (the boxel code).
number
First letter as a zero-based index, 0–25 (A–Z).
number
Second letter as a zero-based index, 0–25.
number
Third letter as a zero-based index, 0–25.
number
The boxel number that follows the letters (d11-96 → 11), a
non-negative integer small enough that the packed code stays exact.
number
The packed base-26 boxel code.
If any letter is not an integer in 0–25, or n1 is not an
integer between 0 and the largest value that still packs exactly. Such a field packs
as a different boxel than the one asked for rather than failing.
import { lettersToBoxelCode } from '@elite-dangerous-almanac/core/astro/system-name';
lettersToBoxelCode(4, 13, 7, 11); // the 'EN-H …11' boxel of a d-class sector