backend/routes/methods/createID.js
/**
    * @description Generates a random ID consisting of numbers and uppercase/lowercase letters.
    * 
    * @return id {String} The 5 digit generated unique ID.
    */
@description Generates a random ID consisting of numbers and uppercase/lowercase letters.

@return id {String} The 5 digit generated unique ID.
@description Generates a random ID consisting of numbers and uppercase / lowercase letters . @return id { String } The 5 digit generated unique ID .
createID(){
   let id = "";
   for (let i = 0; i < 6; i++) {
      const r = Math.random();
      if (r > 0.55) {
         const alpha = Math.random() > 0.5 ? 65 : 97;
         const char = alpha + (Math.floor(Math.random() * 26));
         id += String.fromCharCode(char);
      } else {
         const num = Math.floor(Math.random() * 9);
         id += num.toString();
      }
   }
   return id;
   }
createID ( ) { let id = "" ; for ( let i = 0 ; i < 6 ; i ++ ) { const r = Math . random ( ) ; if ( r > 0.55 ) { const alpha = Math . random ( ) > 0.5 ? 65 : 97 ; const char = alpha + ( Math . floor ( Math . random ( ) * 26 ) ) ; id += String . fromCharCode ( char ) ; } else { const num = Math . floor ( Math . random ( ) * 9 ) ; id += num . toString ( ) ; } } return id ; }
@description Generates a random ID consisting of numbers and uppercase/lowercase letters.
@description Generates a random ID consisting of numbers and uppercase / lowercase letters .
// generate random ID // choose if number or letter // choose if uppercase or lowercase letter // Chooses random character // Converts integer to character.