code: func Hamming(c *curl.Curl, offset, end, security int) Trits {
  	lmid, hmid := pow.Para(c.State)
  
  	lmid[offset] = pow.PearlDiverMidStateLow0
  	hmid[offset] = pow.PearlDiverMidStateHigh0
  	lmid[offset+1] = pow.PearlDiverMidStateLow1
  	hmid[offset+1] = pow.PearlDiverMidStateHigh1
  	lmid[offset+2] = pow.PearlDiverMidStateLow2
  	hmid[offset+2] = pow.PearlDiverMidStateHigh2
  	lmid[offset+3] = pow.PearlDiverMidStateLow3
  	hmid[offset+3] = pow.PearlDiverMidStateHigh3
  
  	cancelled := false
  	nonce, _, foundIndex := pow.Loop(lmid, hmid, security, &cancelled, check, int(c.Rounds))
  	if foundIndex >= 0 {
  		copy(c.State[offset:], ptritsToTrits(lmid, hmid, uint64(foundIndex), len(c.State)-offset))
  		return nonce
  	}
  	return nil
  }
docs: // Hamming calculates the hamming nonce.