diff --git a/cryptopiaAPI.php b/cryptopiaAPI.php index f00aecb..d25c939 100644 --- a/cryptopiaAPI.php +++ b/cryptopiaAPI.php @@ -36,7 +36,7 @@ private function apiCall($method, array $req = array()) { curl_setopt($ch, CURLOPT_URL, $url ); } elseif ( in_array( $method, $private_set ) ) { $url = "https://www.cryptopia.co.nz/Api/" . $method; - $nonce = explode(' ', microtime())[1]; + $nonce = base64_encode(random_bytes(128)); $post_data = json_encode( $req ); $m = md5( $post_data, true ); $requestContentBase64String = base64_encode( $m ); diff --git a/exchange.php b/exchange.php index 9f84793..b2df4b3 100644 --- a/exchange.php +++ b/exchange.php @@ -58,7 +58,7 @@ public function getSymbols() { // note: $exchangeSymbol must be have the base currency first and quote currency second (i.e. eth_btc Not btc_eth). The quote currency is usually BTC, USD, or CNY. public function makeStandardSymbol($exchangeSymbol) { // Convert to Uppercase and remove nonletters. - return preg_replace('/[^A-Z]/', '', strtoupper ( $exchangeSymbol )); + return $exchangeSymbol; } // @todo not implemented for all exchanges, setSymbols() must create associative array $this->symbols with keys as standard symbols and values as exchange symbols for this function to work. public function getExchangeSymbol($standardSymbol) {