# int-encoder

> a simple utitlity to encode and decode ints from a predefined alphabet

Latest version **1.1.1** (published 2018-08-10) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install int-encoder
pnpm add int-encoder
yarn add int-encoder
bun add int-encoder
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-08-10 |
| First published | 2012-11-08 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6.0 |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Alan Clarke |
| Maintainers | alz |

## Links

- npm: https://www.npmjs.com/package/int-encoder
- Repository: https://github.com/alanclarke/int-encoder
- Issues: https://github.com/alanclarke/int-encoder/issues
- npm.io page: https://npm.io/package/int-encoder

## Dependencies (1)

- [bignumber.js](https://npm.io/package/bignumber.js.md) ^2.4.0

## Recent versions

- 1.1.1 (latest) — 2018-08-10
- 1.1.0 — 2016-08-01
- 1.0.0 — 2015-12-08
- 0.1.4 — 2012-11-12
- 0.1.3 — 2012-11-09
- 0.1.2 — 2012-11-09
- 0.1.1 — 2012-11-09
- 0.1.0 — 2012-11-08

## README

# int-encoder

a simple utitlity to encode and decode ints from a predefined alphabet

this includes support for big integers via https://github.com/justmoon/node-bignum

some good uses of this utility include:

- reducing the number of characters required to express a numerical value
- interpreting numerical values expressed in unconventional bases/alphabets

some bad uses of this utility include:
- number obfuscation


## usage
```
npm install int-encoder
```

```javascript
var encoder = require('int-encoder')

encoder.encode(12345678) // "ZXP0"
encoder.decode('ZXP0') // 12345678

//invoke custom alphabet option
encoder.alphabet('0123456789abcdef') // hex alphabet

encoder.encode(255) // "ff"
encoder.decode('ff') // 255

//check what alphabet is being used
encoder.alphabet() // 0123456789abcdef

//convert big hex number using optional base argument
encoder.encode('e6c6b53d3c8160b22dad35a0f705ec09', 16) // 'hbDcW9aE89tzLYjDgyzajJ'
encoder.decode('hbDcW9aE89tzLYjDgyzajJ', 16) // 'e6c6b53d3c8160b22dad35a0f705ec09'

```
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

---
_Source: https://npm.io/package/int-encoder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
