title: Map vectors into integers in a bijective way
body: <p>I have 100,000 5-length vectors (the list VECTORS below) whose elements are chosen among one million values.</p>
  
  <pre><code># dictionary
  dictionary=seq(1:1e6)
  
  # generate 100,000 5-length vectors whose elements are chosen from dictionary
  VECTORS &lt;- lapply(c(1:1e5), sample, x = dictionary, size =5)
  </code></pre>
  
  <p>My problem is to map each exact same vector into one integer, i.e. I need a mappy function that inputs a vector and yields an integer.
  <code>mappy(c(58431, 976854, 661294, 460685, 341123))=15</code>, for example. Do you know how to do this in an efficient way?</p>
  
  <p>Subsidiary question : what if my vectors aren't the same length anymore?</p>