<commit_before>package sss

import (
	"fmt"
)

func Example() {
	// split into 30 shares, of which only 2 are required to combine
	n := 30
	k := 2

	secret := "<PASSWORD> hello there!"
	shares, err := Split(n, k, []byte(secret))
	if err != nil {
		fmt.Println(err)
	}

	// select a random subset of the total shares
	subset := make(map[int][]byte, k)
	for x, y := range shares {
		subset[x] = y
		if len(subset) == k {
			break
		}
	}

	fmt.Println(string(Combine(subset)))
	// Output: well hello there!
}<commit_msg>Tidy up example.<commit_after>package sss

import (
	"fmt"
)

func Example() {
	secret := "<PASSWORD>!" // our secret
	n := 30                       // create 30 shares
	k := 2                        // require 2 of them to combine

	shares, err := Split(n, k, []byte(secret)) // split into 30 shares
	if err != nil {
		fmt.Println(err)
		return
	}

	// select a random subset of the total shares
	subset := make(map[int][]byte, k)
	for x, y := range shares { // just iterate since maps are randomized
		subset[x] = y
		if len(subset) == k {
			break
		}
	}

	// combine two shares and recover the secret
	recovered := string(Combine(subset))
	fmt.Println(recovered)

	// Output: well hello there!
}
{'fraction_non_alphanumeric': 0.13980263157894737, 'fraction_numerical': 0.011513157894736841, 'mean_word_length': 2.7103658536585367, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2789431', 'n_tokens_mistral': 458, 'n_tokens_neox': 413, 'n_words': 143}