@@ -132,13 +132,13 @@ theoretically be used for).
132
132
// Bi-Directional Conversions
133
133
await DashKeys .addrToPkh (address); // PubKey Hash Uint8Array (ShaRipeBytes)
134
134
await DashKeys .pkhToAddr (hashBytes, { version }); // Address (Base58Check-encoded)
135
- await DashKeys .pubKeyToAddr (pubBytes); // Address (Base58Check-encoded)
135
+ await DashKeys .pubkeyToAddr (pubBytes); // Address (Base58Check-encoded)
136
136
await DashKeys .privKeyToWif (privBytes, { version }); // WIF (Base58Check-encoded)
137
137
await DashKeys .wifToPrivKey (wif); // Private Key Uint8Array
138
138
139
139
// One-Way Conversions
140
140
await DashKeys .wifToAddr (wif); // Address (Base58Check-encoded)
141
- await DashKeys .pubKeyToPkh (pubBytes); // shaRipeBytes Uint8Array
141
+ await DashKeys .pubkeyToPkh (pubBytes); // shaRipeBytes Uint8Array
142
142
```
143
143
144
144
** Note** : these all output either Base58Check Strings, or Byte Arrays
@@ -408,8 +408,8 @@ The indicator is `0x02`, if `Y` is ever, or `0x03` if `Y` is odd. \
408
408
In essence:
409
409
410
410
` ` ` js
411
- let expectOdd = 0x03 === pubKey [0 ];
412
- let xBuf = pubKey .subarray (1 );
411
+ let expectOdd = 0x03 === pubkey [0 ];
412
+ let xBuf = pubkey .subarray (1 );
413
413
let xHex = toHex (xBuf);
414
414
let x = BigInt (xHex);
415
415
@@ -621,7 +621,7 @@ let dash58check = Base58Check.create({
621
621
* @param {String} addr
622
622
* @returns {Promise<Uint8Array>} - p2pkh (no magic byte or checksum)
623
623
*/
624
- async function addrToPubKeyHash (addr ) {
624
+ async function addrToPkh (addr ) {
625
625
let b58cAddr = dash58check .decode (addr);
626
626
let pubKeyHash = toBytes (b58cAddr .pubKeyHash );
627
627
return pubKeyHash;
@@ -631,17 +631,17 @@ async function addrToPubKeyHash(addr) {
631
631
* @param {Uint8Array} pubKeyHash - no magic byte or checksum
632
632
* @returns {Promise<String>} - Pay Addr
633
633
*/
634
- async function pubKeyHashToAddr (pubKeyHash ) {
634
+ async function pkhToAddr (pubKeyHash ) {
635
635
let hex = toHex (pubKeyHash);
636
- let addr = await dash58check .encode ({ pubkeyHash : hex });
636
+ let addr = await dash58check .encode ({ pubKeyHash : hex });
637
637
return addr;
638
638
}
639
639
640
640
/**
641
641
* @param {String} wif
642
642
* @returns {Promise<Uint8Array>} - private key (no magic byte or checksum)
643
643
*/
644
- async function wifToPrivateKey (wif ) {
644
+ async function wifToPrivKey (wif ) {
645
645
let b58cWif = dash58check .decode (wif);
646
646
let privateKey = toBytes (b58cWif .privateKey );
647
647
return privateKey;
@@ -651,7 +651,7 @@ async function wifToPrivateKey(wif) {
651
651
* @param {Uint8Array} privKey
652
652
* @returns {Promise<String>} - wif
653
653
*/
654
- async function privateKeyToWif (privKey ) {
654
+ async function privKeyToWif (privKey ) {
655
655
let privateKey = toHex (privKey);
656
656
657
657
let wif = await dash58check .encode ({ privateKey: privateKey });
0 commit comments