npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

alphanumeric-encoder

v1.6.1

Published

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

Downloads

10,211

Readme

Alphanumeric Encoder

NPM Version NPM Package Size License


Tests Build codecov Dependency status Vulnerabilities Open Issues

Maintained contributions welcome



:book: Getting Started

Purpose

alphanumeric-encoder is a lightweight library with no dependencies. It can encode an integer into a letter representation, decode the letter back into a number, and deconstruct combined strings of letters and numbers into an array of decoded numbers.

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
  • Geodesy grid reference systems (e.g. the United States National Grid)

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

console.log(encoder.deconstruct('C7')) // [3, 7]
console.log(encoder.deconstruct('AC22')) // [29, 22]
console.log(encoder.deconstruct('C3ABC123EFGH456')) // [3, 3, 731, 123, 92126, 456]

:gear: API Documentation

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

:hammer_and_wrench: 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.


:clipboard: 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. See the change log for specific details of each release.

Leave a :star2: if you find this project useful!

:envelope: Contact

Maintained by M. Scott Lassiter.

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