@@ 47-51 (lines=5) @@ | ||
44 | private function decodeHex($hex) { |
|
45 | $hex = strtoupper($hex); |
|
46 | $return = "0"; |
|
47 | for ($i = 0; $i < strlen($hex); $i++) { |
|
48 | $current = (string) strpos(self::$hexchars, $hex[$i]); |
|
49 | $return = (string) bcmul($return, "16", 0); |
|
50 | $return = (string) bcadd($return, $current, 0); |
|
51 | } |
|
52 | return $return; |
|
53 | } |
|
54 | ||
@@ 84-88 (lines=5) @@ | ||
81 | $origbase58 = $base58; |
|
82 | ||
83 | $return = "0"; |
|
84 | for ($i = 0; $i < strlen($base58); $i++) { |
|
85 | $current = (string) strpos(Bitcoin::$base58chars, $base58[$i]); |
|
86 | $return = (string) bcmul($return, "58", 0); |
|
87 | $return = (string) bcadd($return, $current, 0); |
|
88 | } |
|
89 | ||
90 | $return = self::encodeHex($return); |
|
91 |