Skip to content

Commit

Permalink
fix leet uppercase bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ipsax committed Nov 25, 2024
1 parent d280648 commit 680f14a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/leet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package internal

import (
"math/rand"
"unicode"
)

type Leet struct{}
Expand Down Expand Up @@ -76,6 +77,7 @@ func (Leet) Encode(str string) string {
leetChars := leetMap()

for _, c := range str {
c := unicode.To(unicode.LowerCase, c)
chars, exists := leetChars[string(c)]
if exists {
selectedLeet := chars[randRange(0, len(chars))]
Expand Down

0 comments on commit 680f14a

Please sign in to comment.