hmm just to be really sure, in case $charset is an invalid charset rather than blank, i'd like this to be:

    $digits = $RAND_CHARSETS{$charset} || $RAND_CHARSETS{default};

or something of the sort.