# smallhash

> Compress data into the smallest string

Latest version **1.0.0** (published 2011-12-14) · 0 weekly downloads

## Install

```sh
npm install smallhash
pnpm add smallhash
yarn add smallhash
bun add smallhash
```

## 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.0.0 |
| Published | 2011-12-14 |
| First published | 2011-12-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Vjeux |
| Maintainers | vjeux |
| Keywords | compression, data, string |

## Links

- npm: https://www.npmjs.com/package/smallhash
- Repository: https://github.com/vjeux/jsSmallHash
- Homepage: http://blog.vjeux.com/2009/javascript/smallhash-information-compression.html
- npm.io page: https://npm.io/package/smallhash

## Dependencies (1)

- [BigInt](https://npm.io/package/BigInt.md) *

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2011-12-14

## README

<a href="http://blog.vjeux.com/2009/javascript/smallhash-information-compression.html">SmallHash</a> - Information Compression
===============

SmallHash encodes any range of integers into the smallest possible string. This way, you can use the hash part of your url with efficiency.


Example
-------

```javascript
var input = [0,0,1,3];
var encoded = SmallHash.encode(input, [2,2,3,5], 'abcdefghijklmnopqrstuvwxyz');
var decoded = SmallHash.decode(encoded, [2,2,3,5], 'abcdefghijklmnopqrstuvwxyz');
console.log(input, encoded, decoded);
// Result: [0, 0, 1, 3], "bo", [0, 0, 1, 3]
```

Read the full explanation on my blog: http://blog.vjeux.com/2009/javascript/smallhash-information-compression.html

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