# shorthash

> Node.js module to get a short unique hash of a string

Latest version **0.0.2** (published 2013-04-19) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2013-04-19 |
| First published | 2013-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 130 |
| Author | Bibig |
| Maintainers | bibig |
| Keywords | hash, shorthash |

## Links

- npm: https://www.npmjs.com/package/shorthash
- Repository: https://github.com/bibig/node-shorthash
- npm.io page: https://npm.io/package/shorthash

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2013-04-19
- 0.0.1 — 2013-04-19

## README

# shorthash

+ A mini Node.js module to generate short, alpha-number, undecryptable and unique hash id from a long string (utf8 format).
+ Use shorthash when you want to encrypt a string like a movie name or a people name to a short, unique and url friendly id.
+ so with shorthash, you can build an id-string map, instead of quering the id from db each time, you just calculate the id out on the fly. 
+ it's quite convenient in many conditions if you want to build a site like [书本画](http://shubenhua.com), a book search engine in China.


## Usage

#### less's more, no options, just unique the string. 

```javascript
var sh = require("shorthash");

console.log(sh.unique('foobar@example.com'));
// you will get: Z1bL2tE

console.log(sh.unique('my name is really big big and big...'));
// you will get: Z1TirWS

console.log(sh.unique('万里长城永不倒。。。'));
// you will get: 2r6EFF

console.log(sh.unique('和平'));
// you will get: 33NM

```

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