- E4FA4700D17D7DA955E3EE980C4A4315E44655DAFDEC0A4657278E174FA92A187DE81C121D30B85A86FD0FE4334867CA73090142C58A3D51083F4EBE7DD4B35C
+ D6DDD7904C370F01107BC69A006501763657F1F87409BB0239C354FC2AA5BCE16C714136B204725A7628EE47939AAF0E5FD1CEA9A9724FBBD2EAB971AB96B413
bitcoin/src/base58.h
(18 . 6)(18 . 7)
5 #include <string>
6 #include <vector>
7 #include "bignum.h"
8 #include "key.h"
9
10 static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
11
(313 . 6)(314 . 53)
13 memcpy(&hash160, &vchData[0], 20);
14 return hash160;
15 }
16
17 };
18
19 /** A base58-encoded secret key */
20 class CBitcoinSecret : public CBase58Data
21 {
22 public:
23 void SetSecret(const CSecret& vchSecret)
24 {
25 assert(vchSecret.size() == 32);
26 SetData(128, &vchSecret[0], vchSecret.size());
27 }
28
29 CSecret GetSecret()
30 {
31 CSecret vchSecret;
32 vchSecret.resize(32);
33 memcpy(&vchSecret[0], &vchData[0], 32);
34 return vchSecret;
35 }
36
37 bool IsValid() const
38 {
39 bool fExpectTestNet = false;
40 switch(nVersion)
41 {
42 case 128:
43 break;
44
45 case 239:
46 fExpectTestNet = true;
47 break;
48
49 default:
50 return false;
51 }
52 return (vchData.size() == 32 || (vchData.size() == 33 && vchData[32] == 1));
53 }
54
55 CBitcoinSecret(const CSecret& vchSecret)
56 {
57 SetSecret(vchSecret);
58 }
59
60 CBitcoinSecret()
61 {
62 }
63 };
64
65 #endif