On 12/12/2008, at 8:39 AM, Noah Slater wrote:

On Fri, Dec 12, 2008 at 08:33:38AM +1030, Antony Blakey wrote:
Why not just do the MD5 and be done with it - erlang:md5(Data) -> Digest ? You remove any limit on the name of a design document, or, for that matter, a database (well, it can't be empty, but then that isn't a name, and obeys 0,1,∞). I think you've already agreed that URL encoding is a good idea, so
this is hardly much effort.

Because this introduces an inconsistency on the file system.

Some databases are held by name, some by hash.

All filenames would be: URLEncode(name) or URLEncode(first X chars of name)-MD5(name). They are always by name, with an optional hash.

I proposed eliminating the hash if the name.length < X because that rule gives a familiar result in what is likely to be virtually every case. I thought that was a gatekeeper preference.

Personally, I too prefer a consistent scheme and propose therefore that the rule is always: URLEncode(first X chars of name)-MD5(name)

And I think X should be a lot smaller than 256, so that longer document names don't lead to UI inconvenience (in e.g. ls or Finder or Explorer).

Antony Blakey
-------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

The difference between ordinary and extraordinary is that little extra.


Reply via email to