code: func (d *MyDecimal) ToHashKey() ([]byte, error) {
  	_, digitsInt := d.removeLeadingZeros()
  	_, digitsFrac := d.removeTrailingZeros()
  	prec := digitsInt + digitsFrac
  	if prec == 0 { // zeroDecimal
  		prec = 1
  	}
  	buf, err := d.ToBin(prec, digitsFrac)
  	if err == ErrTruncated {
  		// This err is caused by shorter digitsFrac;
  		// After removing the trailing zeros from a Decimal,
  		// so digitsFrac may be less than the real digitsFrac of the Decimal,
  		// thus ErrTruncated may be raised, we can ignore it here.
  		err = nil
  	}
  	return buf, err
  }
docs: // ToHashKey removes the leading and trailing zeros and generates a hash key.
  // Two Decimals dec0 and dec1 with different fraction will generate the same hash keys if dec0.Compare(dec1) == 0.