<commit_before>package common

import (
	"math/rand"
	"sync"
	"time"
)

var rndgen = rand.NewSource(time.Now().UnixNano())
var rndMutex = sync.Mutex{}

const (
	MSG_ID_CHARACTERS   = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
	MSG_ID_LENGTH       = 24
	MSG_ID_CHARS_LENGTH = 62
)

func GenRandMsgId() string {
	randData := make([]byte, MSG_ID_LENGTH)
	rndMutex.Lock()
	defer rndMutex.Unlock()
	randData[0] = '_'
	for i := 1; i < MSG_ID_LENGTH; i++ {
		randData[i] = MSG_ID_CHARACTERS[rndgen.Int63()%MSG_ID_CHARS_LENGTH]
	}
	return string(randData)
}

func GenRandMsgIdBytes() []byte {
	rndMutex.Lock()
	defer rndMutex.Unlock()
	randData := make([]byte, MSG_ID_LENGTH)
	for i := 0; i < MSG_ID_LENGTH; i++ {
		randData[i] = MSG_ID_CHARACTERS[rndgen.Int63()%MSG_ID_CHARS_LENGTH]
	}
	return randData
}
<commit_msg>Removed unused code.<commit_after>package common

import (
	"math/rand"
	"sync"
	"time"
)

var rndgen = rand.NewSource(time.Now().UnixNano())
var rndMutex = sync.Mutex{}

const (
	MSG_ID_CHARACTERS   = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
	MSG_ID_LENGTH       = 24
	MSG_ID_CHARS_LENGTH = 62
)

func GenRandMsgId() string {
	randData := make([]byte, MSG_ID_LENGTH)
	rndMutex.Lock()
	defer rndMutex.Unlock()
	randData[0] = '_'
	for i := 1; i < MSG_ID_LENGTH; i++ {
		randData[i] = MSG_ID_CHARACTERS[rndgen.Int63()%MSG_ID_CHARS_LENGTH]
	}
	return UnsafeBytesToString(randData)
}

{'fraction_non_alphanumeric': 0.1309192200557103, 'fraction_numerical': 0.027158774373259052, 'mean_word_length': 5.275109170305677, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, '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': '2311749', 'n_tokens_mistral': 663, 'n_tokens_neox': 632, 'n_words': 99}