code: func EncodeInt64(value int64) (t Trits, size uint64, err error) {
  	size = EncodedLength(value)
  
  	if value == 0 {
  		return encodedZero, size, nil
  	}
  
  	var encoding int64 = 0
  	index := 0
  	length := nearestGreaterMultipleOfThree(MinTrits(MustAbsInt64(value)))
  	t = make(Trits, size)
  	copy(t, IntToTrits(value))
  
  	for i := 0; i < int(length)-TrinaryRadix; i += TrinaryRadix {
  		if TritsToInt(t[i:i+TrinaryRadix]) >= 0 {
  			encoding |= 1 << uint(index)
  			for j := 0; j < TrinaryRadix; j++ {
  				t[i+j] = -t[i+j]
  			}
  		}
  		index++
  	}
  
  	if TritsToInt(t[length-TrinaryRadix:length]) <= 0 {
  		encoding |= 1 << uint(index)
  		for i := 1; i < TrinaryRadix+1; i++ {
  			t[int(length)-i] = -t[int(length)-i]
  		}
  	}
  
  	copy(t[length:], IntToTrits(encoding))
  	return t, size, nil
  }
docs: // EncodeInt64 encodes an int64 as a slice of trits with encoding information.