I would make this a function
goodchars = "0,1,2, etc ,A,C, etc";
lengthoflist = listlen(goodchars);
id = "";
for (i = 1; i gte 6; i = i + 1) {
id = listappend(id, listgetat(goodchars, randrange(1,
lengthoflist);
}
<cfreturn id>
Then you test to see if the id has been used before, and keep
calling it until you have a unique one.