Bitpay\PublicKey::__toString PHP Method

__toString() public method

Returns the compressed public key value
public __toString ( ) : string
return string
    public function __toString()
    {
        if (is_null($this->x)) {
            return '';
        }
        if (Math::mod('0x' . $this->y, '0x02') == '1') {
            return sprintf('03%s', $this->x);
        } else {
            return sprintf('02%s', $this->x);
        }
    }