export const createQueryStringFromObject = (object: any):string => {
    let queryStr: string = ''

    for (const key in object) {
            if (object[key] != null) {
                    queryStr += `${key}=${object[key]}&`
            }
    }
    let lastIndex = queryStr.lastIndexOf('&')
    queryStr = queryStr.slice(0,lastIndex)
    return queryStr
}

// export const makeRandom(lengthOfCode: number) => {
//     let text = "";
//     let possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,./;'[]\=-)(*&^%$#@!~`"
//     for (let i = 0; i < lengthOfCode; i++) {
//         text += possible.charAt(Math.floor(Math.random() * possible.length));
//     }
//         return text;
// }

export function makeRandom(){
    let text = "";
    let possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
    for (let i = 0; i < 5; i++) {
        text += possible.charAt(Math.floor(Math.random() * possible.length));
    }
        return text;
}

