title: List as key for a key value store
body: <p>I want to store key value pair in data base where key is a list of Integers or a set of Integers.</p>
  
  <p>The use case that I have has the below steps</p>
  
  <ol>
  <li>I will get a list of integers</li>
  <li>I will need to check if that list of integers (as a key) is already present in the DB</li>
  <li>If this is present, I will need to pick up the value from the DB</li>
  </ol>
  
  <p>There are certain computations that I need to do if the list of integers (or set of integers) is not there in the DB already, if this there then I just want to pass the value and avoid the computations.</p>
  
  <p>I am thinking of keeping the data in a key value store but I want the key to be specifically a list or set of integers.</p>
  
  <p>I have thought about below options </p>
  
  <p><strong>Option A</strong></p>
  
  <p>Generate a unique hash for the list of integers and store that as key in key/value store</p>
  
  <p>Problem:
  I will have hash collision which will break my use case. I believe there is no way to generate hash with uniqueness 100% of the time.</p>
  
  <p>This will not work.</p>
  
  <p>If there is away to generate a unique hash (100%) times then that is the best way. </p>
  
  <p><strong>Option B</strong></p>
  
  <p>Create an immutable class with List of integers or Set of integers and store that as a key for my key value store.</p>
  
  <p>Please share any feasible ways to achieve the need.</p>