On Tue, 2010-10-05 at 23:28 +0200, Michael Monnerie wrote:
> On Dienstag, 5. Oktober 2010 Alex Elder wrote:
> > PS Two more observations:
> > - There is really no need for the characters to be truly random.
> > Making the generated name unique and different from the
> > original is sufficient. So (with the exception of the last
> > five bytes) we can select the characters however we like.
> > They could be a sequential series of names, for example,
> > rather than computing a random value for each.
> I was thinking the same when reading your description. Why not simply
> "number" the file names from 1 to whatever count of files/dirs there is
> within that dir?
I'm not entirely sure how best to implement it, and I'm open to
As a starting point, I will make it so the random characters making
up the first part of the name are printable, and could probably restrict
it even more than that (say, using lower-case alphabetic and numeric
A scheme with incrementing file names would need to accomodate names of
arbitrary length, too, and it might be better to make the varying part
be at the front of such names.
We need to be aware that there could be duplicates (filenames hashing
to the same value), even though that's unlikely.
In any case the last four and a half bytes of the name will need to
be in the full 8-bit range to make the hash work out right.
I have a few ideas for all of the above. They didn't get out in my
first draft of the patch series because like I said I wanted to get
early feedback rather than waiting to get other stuff implemented.