Trying to get a set of characters using javascript

Hope I explain this right.

I have a script that does random numbers. It only does 5 numbers right now. (like - w4hty)

I am trying to have it do numbers like this

2jsnf-csjxm-cnjc2-fucns-cnash

Like how it does 5 then - then 5 more. I need a total of 25 characters.

Can anyone help me with this?

Here is the code I have for getting just the 5

 <script>
      function makeid(){
        var text = "";
        var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        for( var i=0; i < 5; i++ ){
          text += possible.charAt(Math.floor(Math.random() * possible.length));
        }
        return text;
      }

      document.getElementById("uniqueID").innerHTML = makeid();
    </script>

Something like this should do it:


function makeid(text){
    if(text == undefined)
        var text = '';
        var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        for( var i=0; i < 5; i++ ){
            text += possible.charAt(Math.floor(Math.random() * possible.length));
        }
    
    return text.length < 29 ? makeid(text+"-") :  text;
}