lib/WalletManager.php
/*
     * Decode a base58 encoded Monero address
     *
     * @param string A base58 encoded Monero address
     *
     * @return array An array containing the Address network byte, public spend key, and public view key
     */
Decode a base58 encoded Monero address
@param string A base58 encoded Monero address

@return array An array containing the Address network byte, public spend key, and public view key
Decode a base58 encoded Monero address @param string A base58 encoded Monero address @return array An array containing the Address network byte public spend key and public view key
public function decode_address($address)
    {
        if(!$this->verify_checksum($address)){
            throw new Exception("Error: invalid checksum");
        }
        $decoded = $this->base58->decode($address);
        $network_byte = substr($decoded, 0, 6);
        $public_spendKey = substr($decoded, 6, 64);
        $public_viewKey = substr($decoded, 70, 64);
        $checksum = substr($decoded, -8);
        return array(
            "address" => $address,
            "networkByte" => $network_byte,
            "spendKey" => $public_spendKey,
            "viewKey" => $public_viewKey,
        );
    }
public function decode_address ( $ address ) { if ( ! $ this -> verify_checksum ( $ address ) ) { throw new Exception ( " Error: invalid checksum " ) ; } $ decoded = $ this -> base58 -> decode ( $ address ) ; $ network_byte = substr ( $ decoded , 0 , 6 ) ; $ public_spendKey = substr ( $ decoded , 6 , 64 ) ; $ public_viewKey = substr ( $ decoded , 70 , 64 ) ; $ checksum = substr ( $ decoded , - 8 ) ; return array ( " address " => $ address , " networkByte " => $ network_byte , " spendKey " => $ public_spendKey , " viewKey " => $ public_viewKey , ) ; }
Decode a base58 encoded Monero address
 @param string A base58 encoded Monero address
Decode a base58 encoded Monero address @param string A base58 encoded Monero address