@@ -109,7 +109,7 @@ Bitcoin.ECKey = (function () {
109
109
}
110
110
} ;
111
111
112
- ECKey . prototype . getBitcoinAddress = function ( ) {
112
+ ECKey . prototype . getAddress = function ( ) {
113
113
var hash = this . getPubKeyHash ( ) ;
114
114
var addr = new Bitcoin . Address ( hash ) ;
115
115
return addr ;
@@ -132,8 +132,8 @@ Bitcoin.ECKey = (function () {
132
132
/**
133
133
* Private key encoded as standard Wallet Import Format (WIF)
134
134
*/
135
- ECKey . prototype . getBitcoinWalletImportFormat = function ( ) {
136
- var bytes = this . getBitcoinPrivateKeyByteArray ( ) ;
135
+ ECKey . prototype . getWalletImportFormat = function ( ) {
136
+ var bytes = this . getPrivateKeyByteArray ( ) ;
137
137
bytes . unshift ( ECKey . privateKeyPrefix ) ; // prepend 0x80 byte
138
138
if ( this . compressed ) bytes . push ( 0x01 ) ; // append 0x01 byte for compressed format
139
139
var checksum = Crypto . SHA256 ( Crypto . SHA256 ( bytes , { asBytes : true } ) , { asBytes : true } ) ;
@@ -145,21 +145,21 @@ Bitcoin.ECKey = (function () {
145
145
/**
146
146
* Private key encoded as hexadecimal string.
147
147
*/
148
- ECKey . prototype . getBitcoinHexFormat = function ( ) {
149
- return Crypto . util . bytesToHex ( this . getBitcoinPrivateKeyByteArray ( ) ) . toString ( ) . toUpperCase ( ) ;
148
+ ECKey . prototype . getHexFormat = function ( ) {
149
+ return Crypto . util . bytesToHex ( this . getPrivateKeyByteArray ( ) ) . toString ( ) . toUpperCase ( ) ;
150
150
} ;
151
151
152
152
/**
153
153
* Private key encoded as Base64 string.
154
154
*/
155
- ECKey . prototype . getBitcoinBase64Format = function ( ) {
156
- return Crypto . util . bytesToBase64 ( this . getBitcoinPrivateKeyByteArray ( ) ) ;
155
+ ECKey . prototype . getBase64Format = function ( ) {
156
+ return Crypto . util . bytesToBase64 ( this . getPrivateKeyByteArray ( ) ) ;
157
157
} ;
158
158
159
159
/**
160
160
* Private key encoded as raw byte array.
161
161
*/
162
- ECKey . prototype . getBitcoinPrivateKeyByteArray = function ( ) {
162
+ ECKey . prototype . getPrivateKeyByteArray = function ( ) {
163
163
// Get a copy of private key as a byte array
164
164
var bytes = this . priv . toByteArrayUnsigned ( ) ;
165
165
// zero pad if private key is less than 32 bytes
@@ -170,11 +170,11 @@ Bitcoin.ECKey = (function () {
170
170
ECKey . prototype . toString = function ( format ) {
171
171
format = format || "" ;
172
172
if ( format . toString ( ) . toLowerCase ( ) == "base64" || format . toString ( ) . toLowerCase ( ) == "b64" ) {
173
- return this . getBitcoinBase64Format ( ) ; // Base 64
173
+ return this . getBase64Format ( ) ; // Base 64
174
174
} else if ( format . toString ( ) . toLowerCase ( ) == "wif" ) {
175
- return this . getBitcoinWalletImportFormat ( ) ; // Wallet Import Format
175
+ return this . getWalletImportFormat ( ) ; // Wallet Import Format
176
176
} else {
177
- return this . getBitcoinHexFormat ( ) ; // Hex
177
+ return this . getHexFormat ( ) ; // Hex
178
178
}
179
179
} ;
180
180
0 commit comments