export class StringUtils {
    static rand(length: number): string {
        let result = '';
        const haystack = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
        const haystackLength = haystack.length;

        let counter = 0;
        while (counter < length) {
            result += haystack.charAt(Math.floor(Math.random() * haystackLength));
            counter += 1;
        }

        return result;
    }

}
