You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
773 B
32 lines
773 B
3 years ago
|
function isLetter(source) {
|
||
|
for (i = 0; i < source.length; i++) {
|
||
|
char = source.charCodeAt(i);
|
||
|
if (!((char >= 65 && char <= 90) ||
|
||
|
(char >= 97 && char <= 122) ||
|
||
|
(char >= 48 && char <= 57))) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function isNormalCharacter(source) {
|
||
|
for (i = 0; i < source.length; i++) {
|
||
|
char = source.charCodeAt(i);
|
||
|
if (!(char >= 32 && char <= 126)) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function encryptPassword(password) {
|
||
|
sha256 = CryptoJS.SHA256;
|
||
3 years ago
|
return sha256(sha256(password).toString() + password).toString();
|
||
|
}
|
||
|
|
||
|
function storeToken(token) {
|
||
|
localStorage.setItem("access_token", token);
|
||
3 years ago
|
}
|