ax(mining): replace prose comment with usage example on isValidAlgo
AX Principle 2: comments must show HOW with real values, not restate what the type signature already says. "checks if an algorithm name contains only valid characters" is a prose description — replaced with concrete call examples. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
5b0b0d638e
commit
8247d62ab3
1 changed files with 2 additions and 1 deletions
|
|
@ -221,7 +221,8 @@ func containsShellChars(s string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// isValidAlgo checks if an algorithm name contains only valid characters
|
||||
// isValidAlgo("rx/0") == true
|
||||
// isValidAlgo("rx/0;rm -rf /") == false
|
||||
func isValidAlgo(algo string) bool {
|
||||
for _, r := range algo {
|
||||
if !((r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') || r == '-' || r == '/' || r == '_') {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue