Files
2026-05-26 17:11:13 +02:00

23 lines
373 B
Go

/*
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
*/
package auxtool
import (
"encoding/hex"
"fmt"
"math/rand"
"time"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
func MakeTmpFilename(prefix string) string {
randBytes := make([]byte, 6)
rand.Read(randBytes)
suffix := hex.EncodeToString(randBytes)
return fmt.Sprintf("%s.tmp.%s", prefix, suffix)
}