def hashstring(s):
  """Compute a string hash based on the function "djb2".
  Use at most 64 characters.
  """
  h = 5381
  s = s[0:64]
  for c in s:
    h = ((h << 5) + h + ord(c)) & 0xffffffff
  return h