@mcaptcha/pow_sha256-polyfill
Version:
<div align="center">
26 lines (16 loc) • 825 B
Markdown
<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
import {generate_proof} from "@mcaptcha/pow_sha256-polyfill";
let salt = "randomsaltvalueprovidedbymcaptcha";
let phrase = "randomphrasevalueprovidedbymcaptcha";
let difficulty = 50_000;
let work = await generate_proof(salt, phrase, difficulty);
```