mirror of https://github.com/schollz/croc.git
allow selecting hash
This commit is contained in:
parent
646c879edc
commit
ecf3eb872e
|
@ -55,6 +55,7 @@ func Run() (err error) {
|
||||||
ArgsUsage: "[filename]",
|
ArgsUsage: "[filename]",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{Name: "code", Aliases: []string{"c"}, Usage: "codephrase used to connect to relay"},
|
&cli.StringFlag{Name: "code", Aliases: []string{"c"}, Usage: "codephrase used to connect to relay"},
|
||||||
|
&cli.StringFlag{Name: "hash", Value: "xxhash", Usage: "hash algorithm (xxhash, imohash, md5)"},
|
||||||
&cli.StringFlag{Name: "text", Aliases: []string{"t"}, Usage: "send some text"},
|
&cli.StringFlag{Name: "text", Aliases: []string{"t"}, Usage: "send some text"},
|
||||||
&cli.BoolFlag{Name: "no-local", Usage: "disable local relay when sending"},
|
&cli.BoolFlag{Name: "no-local", Usage: "disable local relay when sending"},
|
||||||
&cli.BoolFlag{Name: "no-multi", Usage: "disable multiplexing"},
|
&cli.BoolFlag{Name: "no-multi", Usage: "disable multiplexing"},
|
||||||
|
@ -199,7 +200,7 @@ func send(c *cli.Context) (err error) {
|
||||||
NoCompress: c.Bool("no-compress"),
|
NoCompress: c.Bool("no-compress"),
|
||||||
Overwrite: c.Bool("overwrite"),
|
Overwrite: c.Bool("overwrite"),
|
||||||
Curve: c.String("curve"),
|
Curve: c.String("curve"),
|
||||||
HashAlgorithm: "xxhash",
|
HashAlgorithm: c.String("hash"),
|
||||||
}
|
}
|
||||||
if crocOptions.RelayAddress != models.DEFAULT_RELAY {
|
if crocOptions.RelayAddress != models.DEFAULT_RELAY {
|
||||||
crocOptions.RelayAddress6 = ""
|
crocOptions.RelayAddress6 = ""
|
||||||
|
@ -408,7 +409,6 @@ func receive(c *cli.Context) (err error) {
|
||||||
IP: c.String("ip"),
|
IP: c.String("ip"),
|
||||||
Overwrite: c.Bool("overwrite"),
|
Overwrite: c.Bool("overwrite"),
|
||||||
Curve: c.String("curve"),
|
Curve: c.String("curve"),
|
||||||
HashAlgorithm: "xxhash",
|
|
||||||
}
|
}
|
||||||
if crocOptions.RelayAddress != models.DEFAULT_RELAY {
|
if crocOptions.RelayAddress != models.DEFAULT_RELAY {
|
||||||
crocOptions.RelayAddress6 = ""
|
crocOptions.RelayAddress6 = ""
|
||||||
|
|
|
@ -776,7 +776,7 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error
|
||||||
c.Options.NoCompress = senderInfo.NoCompress
|
c.Options.NoCompress = senderInfo.NoCompress
|
||||||
c.Options.HashAlgorithm = senderInfo.HashAlgorithm
|
c.Options.HashAlgorithm = senderInfo.HashAlgorithm
|
||||||
if c.Options.HashAlgorithm == "" {
|
if c.Options.HashAlgorithm == "" {
|
||||||
c.Options.HashAlgorithm = "imohash"
|
c.Options.HashAlgorithm = "xxhash"
|
||||||
}
|
}
|
||||||
log.Debugf("using hash algorithm: %s", c.Options.HashAlgorithm)
|
log.Debugf("using hash algorithm: %s", c.Options.HashAlgorithm)
|
||||||
if c.Options.NoCompress {
|
if c.Options.NoCompress {
|
||||||
|
|
Loading…
Reference in New Issue