# jurischain-node

> Instead of challenging the humans who are working at the terminals, it would be better to challenge the terminals themselves. It's all about balancing out the client's workload so they won't be a victim of a DDoS attack. Inspired by Blockchain technology.

Latest version **1.0.0** (published 2022-05-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install jurischain-node
pnpm add jurischain-node
yarn add jurischain-node
bun add jurischain-node
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-05-31 |
| First published | 2022-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 15 |
| Author | tech@bipbop.com.br |
| Maintainers | lfamorim |
| Keywords | captcha, proof-of-work, sha3, blockchain |

## Links

- npm: https://www.npmjs.com/package/jurischain-node
- Repository: https://github.com/bipbop/jurischain
- Homepage: https://github.com/bipbop/jurischain#readme
- Issues: https://github.com/bipbop/jurischain/issues
- npm.io page: https://npm.io/package/jurischain-node

## Dependencies (3)

- [nan](https://npm.io/package/nan.md) ^2.15.0
- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [node-gyp](https://npm.io/package/node-gyp.md) ^8.3.0

## Recent versions

- 1.0.0 (latest) — 2022-05-31

## README

# Jurischain Node

A Node extension written in C++ to use the Jurischain solution, which is a proof of work library.

## TL-DR

```sh
npm install jurischain-node
```

```javascript
import Jurischain from 'jurischain-node'

const jurischain = new Jurischain(10, 'simple-seed');
if (jurischain.challengeResponse(req['challenge-response'])) {
    // grant
} else {
    // deny
}
```

## API

The Jurischain class exposes the following API:

### constructor(difficult: number, seed: string)

Constructs a new Jurischain instance with the given `difficult` and `seed`.

### challengeResponse(response: string): boolean

Challenges the response and returns a boolean indicating whether the response is correct.

### readChallenge(): string

Reads the challenge and returns it as a string.

### solveStep(): boolean

Solves one step of the proof of work and returns a boolean indicating whether the solution is correct.

### verify(): boolean

Verifies the proof of work and returns a boolean indicating whether the verification was successful.

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