mirror of
https://github.com/itchyny/mmv.git
synced 2025-12-26 22:24:58 +08:00
initialize seed of the global random generator using unix timestamp
The algorithm for generating temporary paths is not cryptographically safe, but this is enough in real situation.
This commit is contained in:
parent
5ac7f7d75f
commit
5ee3f57dff
1 changed files with 6 additions and 0 deletions
|
|
@ -5,10 +5,12 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
_ "github.com/mattn/getwild"
|
||||
"github.com/mattn/go-tty"
|
||||
|
|
@ -22,6 +24,10 @@ const version = "0.1.2"
|
|||
|
||||
var revision = "HEAD"
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
func main() {
|
||||
os.Exit(run(os.Args[1:]))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue