ShortURL: Avoid teris-io/shortid (#110456)

This commit is contained in:
Ryan McKinley
2025-09-02 17:01:20 +00:00
committed by GitHub
parent 81fa79cdf6
commit fdac98cdda
9 changed files with 3 additions and 30 deletions
+1 -5
View File
@@ -6,7 +6,6 @@ import (
"testing"
"github.com/stretchr/testify/require"
"github.com/teris-io/shortid"
"k8s.io/apimachinery/pkg/util/validation"
)
@@ -33,11 +32,8 @@ func TestRandomUIDs(t *testing.T) {
func TestCaseInsensitiveCollisionsUIDs(t *testing.T) {
history := make(map[string]bool, 0)
for i := 0; i < 100000; i++ {
for i := range 100000 {
v := GenerateShortUID()
if false {
v, _ = shortid.Generate() // collides in less then 500 iterations
}
lower := strings.ToLower(v)
_, exists := history[lower]