lua-users home
lua-l archive

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


On Wed, Nov 7, 2012 at 7:36 PM, Marc Lepage <mlepage@antimeta.com> wrote:
> I know it's trivial to hash on a single value, by putting it into a table
> field. I want to effectively store a composite key in a table: say, a
> string, a number, and another string.
>
> Is there a way I can somehow produce a single hash of that combination of
> three values, to use as a key in a field? Something not obvious? Or must I
> effectively have a few levels of tables to hash 3 values? (And more for 4,
> 5, 6 values...)
>
> Thanks,
> Marc

The easiest and most obvious option is to simply concatenate them together.

/s/ Adam