Skip to content

Commit 6c4b599

Browse files
authored
Add b64 encoding to generated key output (used in p8e) (#8)
1 parent fad2891 commit 6c4b599

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cmd/extkey/commands/keys.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package commands
22

33
import (
4+
"encoding/base64"
45
"encoding/json"
56
"fmt"
67
"math/big"
@@ -52,6 +53,7 @@ type ExtKeyData struct {
5253

5354
type InnerKeyData struct {
5455
Base58 string `json:"base58" yaml:"base58"`
56+
Base64 string `json:"base64" yaml:"base64"`
5557
Bytes string `json:"bytes" yaml:"bytes,flow"`
5658
BigInt string `json:"bigInt" yaml:"bigInt"`
5759
Proto string `json:"proto" yaml:"proto"`
@@ -93,8 +95,10 @@ func NewInnerKeyData(bz []byte, base58 string, compressed bool) *InnerKeyData {
9395
if err != nil {
9496
panic(err)
9597
}
98+
b64 := base64.StdEncoding.EncodeToString(bz)
9699
return &InnerKeyData{
97100
Base58: base58,
101+
Base64: b64,
98102
Bytes: fmt.Sprintf("%X", bz),
99103
BigInt: (&big.Int{}).SetBytes(bz).String(),
100104
Proto: fmt.Sprintf("%X", protoBz),

0 commit comments

Comments
 (0)