I want to store json key-value pairs in an eosio table. The keys in the json are unique and that's why it would be perfect to use them as primary_key or secondary_id for querying the table later.

The problem is that my keys are sometimes longer than 13 characters and may have symbols. Hence can't be converted to eosio name.

Here is an example:

  "LongStringKeyExample": "some value"

What I tried to do is to wrap it in eosio::name and then use the value attribute to get a uint_64, but that did not work because eosio::name has some restrictions (should be 12 chars, no symbols, only 1-5 numbers, etc...)

What would be the approach to use "LongStringKeyExample" as a primary_key or secondary_id here? can I somehow convert it to uint_128 or uint_64? is this even possible?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.