lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Jan 6, 2012, at 4:41 PM, Roberto Ierusalimschy wrote:

> The drawbacks would be for programs that use very long keys
> (longer than 32 bytes or some other limit) or that regularly
> compare such long strings between them for equality or that
> create multiple copies of such long strings. I may be wrong,
> but I think neither of these cases are common.

An hex encoded UUID is 32 characters long (36  when formatted).
An hex encoded MD5 is 32 characters long.
An hex encoded SHA1 is 40 characters long.
An hex encoded SHA2-512 is 128 characters long.
A formatted IP6 address is 39 characters long.
An URL is quite often more than 32 character long (e.g. http://www.lua.org/manual/5.2/manual.html#2 is 43 character long).
A Tag URI is quite often more than 32 character long (e.g. tag:user@example.com,2007-11-02:Tag_URI is 39 character long)
A, say, ISAN URN is 42 character long.
A formatted French IBAN identifier is 33 characters long.
etc, etc, etc

32 bytes seems rather short these days. Don't even want to think about how things are going to be tomorrow...

Plus, this short vs. long segregation seems rather arbitrary and would quite complicate the mental model of what a Lua string is and how it ought to behave. 

Doesn't sound very appealing all in all.