From 76ff717acf591f0d3c6b8149f5ca31c0594d43b5 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Tue, 7 Dec 2021 19:10:38 +0530 Subject: [PATCH] add README --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8444fa7 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +
+ +

PoW JavaScript library

+ +JavaScript library to generate PoW for mCaptcha + +[![0.1.0](https://img.shields.io/badge/TypeScript_docs-master-2b7489)](https://mcaptcha.github.io/pow_sha256-polyfill/) +![Build)]() +[![codecov](https://codecov.io/gh/mCaptcha/pow_sha256-polyfill/branch/master/graph/badge.svg)](https://codecov.io/gh/mCaptcha/pow_sha256-polyfill) + +
+ +## Usage + +To generate proof-of-work, per mCaptcha specification: + +```typescript +import {generate_proof} from "@mcaptcha/pow_sha256-polyfill"; /* yet to +be published in npm */ + + +let salt = "randomsaltvalueprovidedbymcaptcha"; +let phrase = "randomphrasevalueprovidedbymcaptcha"; +let difficulty = 50_000; + +let work = await generate_proof(salt, phrase, difficulty); +```