1.0.0 • Published 4 years ago
guardian-recovery v1.0.0
Guardian Recovery
This PoC is an implementation based on Shamir's secret sharing which uses secret.js library.
Installation
npm install --save guardian-recoveryImport
const GR = require('guardian-recovery');
const guardianRecovery = new GR();Functions
Create Shards
const shards = guardianRecovery.createShards(input, m, n);- input - The data to be sharded
- m - The number of shards
- n - Threshold shards to be recovered
input should be in a string format.
Recover Data
const data = guardianRecovery.recoverData(shards);- shards - The minimum number of shards or more in an array
String to Hex
const hex = guardianRecovery.str2hex(input);- input - Input in string
Hex to String
const string = guardianRecovery.hex2str(input);- input - Input in hex
1.0.0
4 years ago