# url-hash

> Node library to add hash parameter for tamper-free urls

Latest version **1.0.2** (published 2015-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install url-hash
pnpm add url-hash
yarn add url-hash
bun add url-hash
```

## 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.2 |
| Published | 2015-02-23 |
| First published | 2015-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jonathan Prince |
| Maintainers | jonathanprince |
| Keywords | hash, url, security, parameters |

## Links

- npm: https://www.npmjs.com/package/url-hash
- Repository: https://github.com/JonathanPrince/url-hash
- Issues: https://github.com/JonathanPrince/url-hash/issues
- npm.io page: https://npm.io/package/url-hash

## Dependencies (1)

- [crypto](https://npm.io/package/crypto.md) 0.0.3

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2015-02-23
- 1.0.1 — 2015-02-20
- 1.0.0 — 2015-02-20

## README

# url-hash
Node library to add hash parameter for tamper-free urls

## Basic Usage

### Add hash to url

```js

// require library
var urlHash = require('url-hash');

var url = 'http://www.example.com/page?id=4';

// add hash to url
var newUrl = urlHash.create(url);

```

### Verify Url

```js

// require library
var urlHash = require('url-hash');

// check integrity of url
var result = urlHash.check(url/to/verify);

/*

  result will either:
  1. equal true if the url is unchanged
  2. equal false if the url has been changed

*/
```

## Configuration options

This library currently offers the following configuration options:

- salt
- expire
- hash key name

```js

urlHash.config({
                salt:    'someUniqueCustomSalt', // use custom salt (recommended)
                expire:  60000,                  // url expires after 1 minute
                hashKey: 'myCustomHashKeyName'   // use custom name for hash parameter
              });

```

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