JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2850
  • Score
    100M100P100Q129962F
  • License MIT

Encodes a number to a letter representation, or decodes it back

Package Exports

  • alphanumeric-encoder
  • alphanumeric-encoder/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (alphanumeric-encoder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Alphanumeric Encoder

NPM Version NPM Package Size License


Tests Build codecov Dependency status Vulnerabilities Open Issues

Maintained contributions welcome


Table of Contents

📖 Getting Started

Purpose

alphanumeric-encoder is a lightweight library with no dependencies. It can encode an integer into a letter representation, and decode the letter back into a number.

This is useful for converting letter indexes (used by people) to numbers (used by computers). Examples include:

  • Spreadsheet columns (e.g. Microsoft Excel's end column is "XFD" which corresponds to 16384)
  • Game boards (e.g. Chess, Battleship) use letters and numbers to identify the grid
  • Geographic grid reference systems

Install as an NPM Package

npm install alphanumeric-encoder

Use in Javascript

const AlphanumericEncoder = require('alphanumeric-encoder')

const encoder = new AlphanumericEncoder()

console.log(encoder.encode(5)) // 'E'
console.log(encoder.encode(48)) // 'AV'
console.log(encoder.encode(733)) // 'ABE'

console.log(encoder.decode('A')) // 1
console.log(encoder.decode('AC')) // 29
console.log(encoder.decode('ANE')) // 1045

⚙️ API Documentation

See the API for more detailed information on how to use the class.

🛠️ Node and Operating System Support Policy

The test suite has successfully run on all combinations of:

  • Node Versions Supported
  • Windows Supported Mac Supported Linux Supported

This project supports Long-Term Support, Current, and Maintenance versions of node. Once a version reaches end of life, the CI scripts will no longer support them. Odd Node versions will only receive support while in a current status.

Other Node versions and operating systems might support the library, but the tests have not verified other combinations.


📋 License and Development

alphanumeric-encoder and all other files in this repository are distributed as free and open-source software under the MIT License, © 2022.

Both contributions and bug reports welcome.

Leave a 🌟 if you find this project useful!

✉️ Contact

Maintained by M. Scott Lassiter.

GitHub Badge Profile Twitter Badge Profile LinkedIn Badge Profile Stackoverflow Badge Profile