# @tadashi/signature

> Generates and verifies signatures

Latest version **3.0.0** (published 2023-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tadashi/signature
pnpm add @tadashi/signature
yarn add @tadashi/signature
bun add @tadashi/signature
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2023-08-29 |
| First published | 2017-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Thiago Lagden |
| Maintainers | lagden |
| Keywords | event, emitter, ee, singleton, nodejs |

## Links

- npm: https://www.npmjs.com/package/@tadashi/signature
- npm.io page: https://npm.io/package/@tadashi/signature

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 3.0.0 (latest) — 2023-08-29
- 2.0.3 — 2020-01-03
- 2.0.2 — 2019-12-22
- 2.0.1 — 2018-04-14
- 2.0.0 — 2017-09-08

## README

# @tadashi/signature

[![NPM version][npm-img]][npm]
[![Build Status][ci-img]][ci]
[![Coverage Status][coveralls-img]][coveralls]


[npm-img]:         https://img.shields.io/npm/v/@tadashi/signature.svg
[npm]:             https://www.npmjs.com/package/@tadashi/signature
[ci-img]:          https://github.com/lagden/signature/actions/workflows/nodejs.yml/badge.svg
[ci]:              https://github.com/lagden/signature/actions/workflows/nodejs.yml
[coveralls-img]:   https://coveralls.io/repos/github/lagden/signature/badge.svg?branch=master
[coveralls]:       https://coveralls.io/github/lagden/signature?branch=master


---

Generates and verifies signatures

## Install

```
$ npm i -S @tadashi/signature
```


## Usage

### Generate

```js
import {generate} from '@tadashi/signature'

const algorithm = 'sha1'
const payload = '{}'
const secret = 'a7fee042a2e1a9fa27cfc6931949ffe1'

const signature = generate(algorithm, payload, secret)
// => sha1=61ca6afb7b2752e106c939df11bbd7ca883b8166
```

### Verify

```js
import {verify} from '@tadashi/signature'

const signature = 'sha1=61ca6afb7b2752e106c939df11bbd7ca883b8166'
const payload = '{}'
const secret = 'a7fee042a2e1a9fa27cfc6931949ffe1'

const isValid = verify(signature, payload, secret)
// => true
```


## API

### generate(algorithm, payload, secret)

parameter   | type                 | required    | description
----------- | -------------------- | ----------- | ------------
signature   | string               | yes         | Algorithm that will be used
payload     | string               | yes         | Data to generate
secret      | string               | yes         | Some expression

### verify(signature, payload, secret)

parameter   | type                 | required    | description
----------- | -------------------- | ----------- | ------------
signature   | string               | yes         | Algorithm used + hash e.g. `sha1=61c...675`
payload     | string               | yes         | Data used to generate the hash
secret      | string               | yes         | The same expression used to generate


## Donate ❤️

- BTC: bc1q7famhuj5f25n6qvlm3sssnymk2qpxrfwpyq7g4


## License

MIT © [Thiago Lagden](https://github.com/lagden)


[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flagden%2Fsignature.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Flagden%2Fsignature?ref=badge_large)

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