@@ -4,7 +4,6 @@ package logo
44import (
55 "fmt"
66 "image/color"
7− "math/rand/v2"
87 "strings"
98
109 "github.com/MakeNowJust/heredoc"
@@ -53,7 +52,7 @@ func Render(version string, compact bool, o Opts) string {
5352 }
5453 stretchIndex := -1 // -1 means no stretching.
5554 if !compact {
56− stretchIndex = rand.IntN(len(letterforms))
55+ stretchIndex = cachedRandN(len(letterforms))
5756 }
5857
5958 crush := renderWord(spacing, stretchIndex, letterforms...)
@@ -337,7 +336,7 @@ func stretchLetterformPart(s string, p letterformProps) string {
337336 }
338337 n := p.width
339338 if p.stretch {
340− n = rand.IntN(p.maxStretch-p.minStretch) + p.minStretch //nolint:gosec
339+ n = cachedRandN(p.maxStretch-p.minStretch) + p.minStretch //nolint:gosec
341340 }
342341 parts := make([]string, n)
343342 for i := range parts {