No description
Find a file
realaravinth 9ea8676d24
pow_sha256 serializes the phrase on which the proof is to be computed
using the bincode crate, which uses UTF-8 under the hood and also
prefixes the length of the string in big endian.

This patch introduces changes to implement the same
2021-12-08 13:43:24 +05:30
.github CI: downgrade node env 2021-12-07 19:06:47 +05:30
src pow_sha256 serializes the phrase on which the proof is to be computed 2021-12-08 13:43:24 +05:30
.eslintrc.js setup tests and linting 2021-12-07 19:01:36 +05:30
.gitignore polyfill implementation 2021-12-07 15:35:10 +05:30
jest.config.ts pow_sha256 serializes the phrase on which the proof is to be computed 2021-12-08 13:43:24 +05:30
LICENSE_APACHE added licenses 2021-06-27 21:31:59 +05:30
LICENSE_MIT added licenses 2021-06-27 21:31:59 +05:30
package.json setup tests and linting 2021-12-07 19:01:36 +05:30
README.md add README 2021-12-07 19:10:38 +05:30
tsconfig.json setup tests and linting 2021-12-07 19:01:36 +05:30
webpack.config.js digest 2021-06-27 21:31:09 +05:30
yarn.lock setup tests and linting 2021-12-07 19:01:36 +05:30

PoW JavaScript library

JavaScript library to generate PoW for mCaptcha

0.1.0 Build) codecov

Usage

To generate proof-of-work, per mCaptcha specification:

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);