lib/WalletManager.php
// takes transaction extra field as hex string and returns transaction public key 'R' as hex string
takes transaction extra field as hex string and returns transaction public key 'R' as hex string
takes transaction extra field as hex string and returns transaction public key ' R ' as hex string
public function txpub_from_extra($extra)
    {
        $parsed = array_map("hexdec", str_split($extra, 2));
        if($parsed[0] == 1)
        {
            return substr($extra, 2, 64);
        }
        if($parsed[0] == 2)
        {
            if($parsed[0] == 2 || $parsed[2] == 1)
            {
                $offset = (($parsed[1] + 2) *2) + 2;
                return substr($extra, (($parsed[1] + 2) *2) + 2, 64);
            }
        }
    }
public function txpub_from_extra ( $ extra ) { $ parsed = array_map ( " hexdec " , str_split ( $ extra , 2 ) ) ; if ( $ parsed [ 0 ] == 1 ) { return substr ( $ extra , 2 , 64 ) ; } if ( $ parsed [ 0 ] == 2 ) { if ( $ parsed [ 0 ] == 2 || $ parsed [ 2 ] == 1 ) { $ offset = ( ( $ parsed [ 1 ] + 2 ) * 2 ) + 2 ; return substr ( $ extra , ( ( $ parsed [ 1 ] + 2 ) * 2 ) + 2 , 64 ) ; } } }
takes transaction extra field as hex string and returns transaction public key 'R' as hex string
takes transaction extra field as hex string and returns transaction public key ' R ' as hex string