title: Can I encode a string to an integer in a way that preserves lexicographic string closeness?
body: <p>I would like to encode strings of varying length (typically 1-100 characters) to integers in a way that strings which are lexicographically similar (they would be close together in a dictionary) result in integers that are close together, while further ensuring that these integers are reasonably evenly distributed across the range of possible integer values.</p>
  
  <p>I recognize that ensuring an even distribution may require some kind of survey of the possible strings prior to encoding them.</p>
  
  <p>Does anyone have any ideas on how to do this?</p>