I'm developing a Smart Contract for EOSIO. I have a Multi-Index table with a uint64_t
primary key. I'd like to add a secondary index to the table.
Ideally the data I'd be indexing on would be a std::string
, but I'm under the impression that EOS does not allow that. I do see something in the documentation referred to as an idx256
described as a "256-bit fixed-size lexicographical key", though it is unclear how to construct one.
How do I create an idx256
? What conversions must I do to a std::string
to make it work (truncate or otherwise manipulate)? What are my limitations (for instance, is this a one-way conversion similar to hashing)? Any gotchas or other concerns I should be aware of?
""_n
/name{""}
syntax? I mean...that might actually work for my purposes! I'm going to pursue this for a bit today and see if I can make it work for me"key": "alice"