<commit_before>package command

import (
	"flag"
	"fmt"
	"math/rand"
	"strings"
	"time"

	"github.com/navy/memberid/registry"
)

type RandomCommand struct {
	To    string
	Group string
}

func (c *RandomCommand) ConfigureFlags(fs *flag.FlagSet) {
	fs.StringVar(&c.To, "to", "", "id-type to")
	fs.StringVar(&c.Group, "group", "", "group name")
}

func (c *RandomCommand) Help() string {
	return "[-to=<TO>] [-group=<GROUP>]"
}

func (c *RandomCommand) Run(fs *flag.FlagSet, r registry.Registry) {
	var ids []string
	if c.Group != "" {
		ids = r.Ids(strings.Split(c.Group, ",")...)
	} else {
		ids = r.Ids()
	}

	if len(ids) == 0 {
		fmt.Print("No members\n")
		return
	}

	rand.Seed(time.Now().Unix())
	id := ids[rand.Intn(len(ids))]

	if c.To != "" {
		id = r.ResolveId(id, "", c.To)
	}

	fmt.Printf("%s\n", id)
}<commit_msg>Use UnixNano as seed<commit_after>package command

import (
	"flag"
	"fmt"
	"math/rand"
	"strings"
	"time"

	"github.com/navy/memberid/registry"
)

type RandomCommand struct {
	To    string
	Group string
}

func (c *RandomCommand) ConfigureFlags(fs *flag.FlagSet) {
	fs.StringVar(&c.To, "to", "", "id-type to")
	fs.StringVar(&c.Group, "group", "", "group name")
}

func (c *RandomCommand) Help() string {
	return "[-to=<TO>] [-group=<GROUP>]"
}

func (c *RandomCommand) Run(fs *flag.FlagSet, r registry.Registry) {
	var ids []string
	if c.Group != "" {
		ids = r.Ids(strings.Split(c.Group, ",")...)
	} else {
		ids = r.Ids()
	}

	if len(ids) == 0 {
		fmt.Print("No members\n")
		return
	}

	rand.Seed(time.Now().UTC().UnixNano())
	id := ids[rand.Intn(len(ids))]

	if c.To != "" {
		id = r.ResolveId(id, "", c.To)
	}

	fmt.Printf("%s\n", id)
}
{'fraction_non_alphanumeric': 0.21535692861427713, 'fraction_numerical': 0.0011997600479904018, 'mean_word_length': 3.5950413223140494, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2529340', 'n_tokens_mistral': 725, 'n_tokens_neox': 700, 'n_words': 143}