other components... (2)

This commit is contained in:
Paolo Arena
2021-09-16 21:08:02 +02:00
parent fcc4f61f07
commit f351673917
276 changed files with 17183 additions and 3371 deletions

13
src/validation/alfanum.ts Executable file
View File

@@ -0,0 +1,13 @@
export function alfanum(username: string) {
let code, i, len
for (i = 0, len = username.length; i < len; i++) {
code = username.charCodeAt(i)
if (!(code > 47 && code < 58) && // numeric (0-9)
!(code > 64 && code < 91) && // upper alpha (A-Z)
!(code > 96 && code < 123)) { // lower alpha (a-z)
return false
}
}
return true
}