2
$\begingroup$

I need to reduce the amount of stored data in an Ethereum Smart Contract. Currently I am storing $n < 2^8$ strings in a mapping (i.e. a map data structure) and each string is mapped into $[0, n)$; since this uses up to much memory, I'm looking for ways to compute the mapping instead of reading it from storage.

I've looked into Gödel numbering, but it creates big numbers and I have no clue how I can change the image set to $[0, n)$.


The strings have a length of 2 to 7 and consist of capital letters, numbers, and dashes.

$\endgroup$
  • $\begingroup$ Would Huffman Coding be applicable to the data? $\endgroup$ – CyclotomicField Aug 19 at 23:56
  • $\begingroup$ @CyclotomicField The set of possible characters has a fixed size, so it would be possible. $\endgroup$ – mike Aug 20 at 8:14

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.