No description
realaravinth
9ea8676d24
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 |
||
---|---|---|
.github | ||
src | ||
.eslintrc.js | ||
.gitignore | ||
jest.config.ts | ||
LICENSE_APACHE | ||
LICENSE_MIT | ||
package.json | ||
README.md | ||
tsconfig.json | ||
webpack.config.js | ||
yarn.lock |
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);