feat: use RandomString function for wallet's salt
This commit is contained in:
parent
be8d5dfe60
commit
27ce2d499d
2 changed files with 2 additions and 6 deletions
|
@ -15,6 +15,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|||
### Changed
|
||||
|
||||
- Export in a file
|
||||
- Use RandomString function for wallet's salt
|
||||
|
||||
## v1.1.0 - 2019-07-23
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"regexp"
|
||||
"time"
|
||||
|
@ -78,11 +77,7 @@ func (w *Wallet) Load() error {
|
|||
// Save the wallet on the disk
|
||||
func (w *Wallet) Save() error {
|
||||
if w.Salt == "" {
|
||||
salt := make([]byte, 8)
|
||||
for i := 0; i < 8; i++ {
|
||||
salt[i] = byte(65 + rand.Intn(25))
|
||||
}
|
||||
w.Salt = string(salt)
|
||||
w.Salt = RandomString(12, true, true, false)
|
||||
}
|
||||
|
||||
data, err := json.Marshal(&w.Entries)
|
||||
|
|
Loading…
Reference in a new issue