code: func messageHashPartition(key []byte, partitions int32) (int32, error) {
  	if key == nil {
  		return 0, errors.New("no key")
  	}
  	hasher := fnv.New32a()
  	if _, err := hasher.Write(key); err != nil {
  		return 0, fmt.Errorf("cannot hash key: %s", err)
  	}
  	sum := int32(hasher.Sum32())
  	if sum < 0 {
  		sum = -sum
  	}
  	return sum % partitions, nil
  }
docs: // messageHashPartition compute destination partition number for given key
  // value and total number of partitions.