code: func TritsToInt(t Trits) int64 {
  	var val int64
  	for i := len(t) - 1; i >= 0; i-- {
  		val = val*3 + int64(t[i])
  	}
  	return val
  }
docs: // TritsToInt converts a slice of trits into an integer and assumes little-endian notation.