This PoC is an implementation based on Shamir's secret sharing which uses secret.js library.
npm install --save guardian-recovery
const GR = require('guardian-recovery');
const guardianRecovery = new GR();
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.
const data = guardianRecovery.recoverData(shards);
- shards - The minimum number of shards or more in an array
const hex = guardianRecovery.str2hex(input);
- input - Input in string
const string = guardianRecovery.hex2str(input);
- input - Input in hex