2021-12-07 19:10:38 +05:30
|
|
|
<div align="center">
|
|
|
|
|
|
|
|
<h1>PoW JavaScript library</h1>
|
|
|
|
|
|
|
|
<strong>JavaScript library to generate PoW for mCaptcha</strong>
|
|
|
|
|
|
|
|
[](https://mcaptcha.github.io/pow_sha256-polyfill/)
|
|
|
|
/badge.svg>)
|
|
|
|
[](https://codecov.io/gh/mCaptcha/pow_sha256-polyfill)
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
To generate proof-of-work, per mCaptcha specification:
|
|
|
|
|
|
|
|
```typescript
|
2021-12-08 14:28:38 +05:30
|
|
|
import {generate_proof} from "@mcaptcha/pow_sha256-polyfill";
|
2021-12-07 19:10:38 +05:30
|
|
|
|
|
|
|
let salt = "randomsaltvalueprovidedbymcaptcha";
|
|
|
|
let phrase = "randomphrasevalueprovidedbymcaptcha";
|
|
|
|
let difficulty = 50_000;
|
|
|
|
|
|
|
|
let work = await generate_proof(salt, phrase, difficulty);
|
|
|
|
```
|
2023-03-08 17:26:23 +05:30
|
|
|
|
|
|
|
## Funding
|
|
|
|
|
|
|
|
### NLnet
|
|
|
|
|
|
|
|
<div align="center">
|
|
|
|
<img
|
|
|
|
height="150px"
|
|
|
|
alt="NLnet NGIZero logo"
|
|
|
|
src="./static/third-party/NGIZero-green.hex.svg"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
2023 development is funded through the [NGI0 Entrust
|
|
|
|
Fund](https://nlnet.nl/entrust), via [NLnet](https://nlnet.nl/). Please
|
|
|
|
see [here](https://nlnet.nl/project/mCaptcha/) for more details.
|