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

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

Function: 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).

Parameters

l1

number

First letter as a zero-based index, 025 (AZ).

l2

number

Second letter as a zero-based index, 025.

l3

number

Third letter as a zero-based index, 025.

n1

number

The boxel number that follows the letters (d11-9611), a non-negative integer small enough that the packed code stays exact.

Returns

number

The packed base-26 boxel code.

Throws

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.

Example

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
⚠️ **GitHub.com Fallback** ⚠️