Follow-up Comment #3, bug #68136 (group groff): Do these tags need to be unique? The quoted rand() algorithm, while making duplicates unlikely, doesn't guarantee uniqueness.
Do the tags need to be random? Could they be merely sequential? The rand()
algorithm could theoretically generate the sequence AAAAAA AAAAAB AAAAAC
anyway, so it seems like it should be fine to algorithmically generate
this--which also guarantees both uniqueness and reproducibility.
Example (not necessarily the best) implementation:
{
# in perl 5.10+, this could be a "state" variable inside SubTag
my $res = 'AAAAAA';
sub SubTag
{
do {
$res = sprintf ("%X", hex($res)+1);
} until $res !~ /\d/;
return($res.'+');
}
}
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68136>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
