コード例 #1
0
 public function testBase58EncodeValues()
 {
     // Taken from Bitcoin Core's ./src/tests/data/base58_encode_decode.json file
     $tests = ["" => "", "61" => "2g", "626262" => "a3gV", "636363" => "aPEr", "73696d706c792061206c6f6e6720737472696e67" => "2cFupjhnEsSn59qHXstmK2ffpLv2", "00eb15231dfceb60925886b67d065299925915aeb172c06647" => "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L", "516b6fcd0f" => "ABnLTmg", "bf4f89001e670274dd" => "3SEo3LWLoPntC", "572e4794" => "3EFU7m", "ecac89cad93923c02321" => "EJDM8drfXA6uyA", "10c8511e" => "Rt5zm", "00000000000000000000" => "1111111111"];
     foreach ($tests as $data => $equals) {
         $res = BitcoinLib::base58_encode(trim($data));
         $this->assertEquals($res, $equals);
     }
 }