fix style height when rotating + move cookie util to their specific file

This commit is contained in:
Hamidreza Ghavami
2023-05-08 18:04:12 +04:30
parent 00777e3a25
commit d137deccfa
6 changed files with 89 additions and 80 deletions

View File

@@ -68,13 +68,11 @@ class HttpUtil {
}
class PromiseUtil {
static async sleep(timeout) {
await new Promise(resolve => {
setTimeout(resolve, timeout)
});
}
}
const seq = [
@@ -95,7 +93,6 @@ const shortIdSeq = [
];
class RandomUtil {
static randomIntRange(min, max) {
return parseInt(Math.random() * (max - min) + min, 10);
}
@@ -153,8 +150,8 @@ class RandomUtil {
static randomText() {
var chars = 'abcdefghijklmnopqrstuvwxyz1234567890';
var string = '';
var len = 6 + Math.floor(Math.random() * 5)
for(var ii=0; ii<len; ii++){
var len = 6 + Math.floor(Math.random() * 5);
for (var ii = 0; ii < len; ii++) {
string += chars[Math.floor(Math.random() * chars.length)];
}
return string;
@@ -162,11 +159,11 @@ class RandomUtil {
static randowShortId() {
let str = '';
str += this.randomShortIdSeq(8)
str += this.randomShortIdSeq(8);
return str;
}
static randomShadowsocksPassword(){
static randomShadowsocksPassword() {
let array = new Uint8Array(32);
window.crypto.getRandomValues(array);
return btoa(String.fromCharCode.apply(null, array));
@@ -174,7 +171,6 @@ class RandomUtil {
}
class ObjectUtil {
static getPropIgnoreCase(obj, prop) {
for (const name in obj) {
if (!obj.hasOwnProperty(name)) {
@@ -322,5 +318,4 @@ class ObjectUtil {
}
return true;
}
}