code: func canonicalDataSize(data []byte) int {
  	dataLen := len(data)
  
  	// When the data consists of a single number that can be represented
  	// by one of the "small integer" opcodes, that opcode will be instead
  	// of a data push opcode followed by the number.
  	if dataLen == 0 {
  		return 1
  	} else if dataLen == 1 && data[0] <= 16 {
  		return 1
  	} else if dataLen == 1 && data[0] == 0x81 {
  		return 1
  	}
  
  	if dataLen < OP_PUSHDATA1 {
  		return 1 + dataLen
  	} else if dataLen <= 0xff {
  		return 2 + dataLen
  	} else if dataLen <= 0xffff {
  		return 3 + dataLen
  	}
  
  	return 5 + dataLen
  }
docs: // canonicalDataSize returns the number of bytes the canonical encoding of the
  // data will take.