/* Examples: value -> result 105 -> 11 104 -> 10 -205 -> -21 -204 -> -20  */
uint32_t hash(const void *ptr, uint32_t size)
/* Examples: value -> result 105 -> 11 104 -> 10 -205 -> -21 -204 -> -20  */
uint32_t hash(const void *ptr, uint32_t size)
{
  const uint8_t * data = (const uint8_t *)ptr;
  uint32_t hash = 5381;
  for (uint32_t i=0; i<size; i++) {
    hash = ((hash << 5) + hash) + data[i]; 
  }
  return hash;
}