Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed May 13, 2019
1 parent 7745727 commit 2044663
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ Run example with
```rust
extern crate secretsharing;

use secretsharing::ss::{reconstruct_secret, Charset, SecretSharing};
use secretsharing::ss::{Charset, SecretSharing};

fn main() {
let threshold = 3;
let total_shares = 5;
let secret = "HelloWorld123";
let mut ss = SecretSharing::new(
threshold, // Minimum shares required for reconstruction.
total_shares, // Total shares.
Charset::Alphanumeric // Charset of secret.
threshold, // Minimum shares required for reconstruction.
total_shares, // Total shares.
Charset::Alphanumeric, // Charset of secret.
);
let shares = ss.generate_shares(secret).unwrap();
let reconstructed_secret = reconstruct_secret(&shares[0..3].to_vec(), ss).unwrap();
let reconstructed_secret = ss.reconstruct_secret(&shares[0..3].to_vec()).unwrap();
assert_eq!(reconstructed_secret, secret);
}


```

0 comments on commit 2044663

Please sign in to comment.