Пример #1
0
// NewSecret creates a new random secret for a user.
func NewSecret(username string) (*Secret, error) {
	words, err := libkb.SecWordList(libkb.KexSessionIDEntropy)
	if err != nil {
		return nil, err
	}
	phrase := strings.Join(words, " ")
	return SecretFromPhrase(username, phrase)
}
func genUsername() string {
	w, _ := libkb.SecWordList(1)
	var buf [4]byte
	rand.Read(buf[:])
	return fmt.Sprintf("%s%x", w[0], buf)
}