diff --git a/src/cli/cli.go b/src/cli/cli.go index ed6d0e9..388ebbe 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -55,6 +55,7 @@ func Run() (err error) { ArgsUsage: "[filename]", Flags: []cli.Flag{ &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.BoolFlag{Name: "no-local", Usage: "disable local relay when sending"}, &cli.BoolFlag{Name: "no-multi", Usage: "disable multiplexing"}, @@ -199,7 +200,7 @@ func send(c *cli.Context) (err error) { NoCompress: c.Bool("no-compress"), Overwrite: c.Bool("overwrite"), Curve: c.String("curve"), - HashAlgorithm: "xxhash", + HashAlgorithm: c.String("hash"), } if crocOptions.RelayAddress != models.DEFAULT_RELAY { crocOptions.RelayAddress6 = "" @@ -408,7 +409,6 @@ func receive(c *cli.Context) (err error) { IP: c.String("ip"), Overwrite: c.Bool("overwrite"), Curve: c.String("curve"), - HashAlgorithm: "xxhash", } if crocOptions.RelayAddress != models.DEFAULT_RELAY { crocOptions.RelayAddress6 = "" diff --git a/src/croc/croc.go b/src/croc/croc.go index e23323f..c7dcfec 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -776,7 +776,7 @@ func (c *Client) processMessageFileInfo(m message.Message) (done bool, err error c.Options.NoCompress = senderInfo.NoCompress c.Options.HashAlgorithm = senderInfo.HashAlgorithm if c.Options.HashAlgorithm == "" { - c.Options.HashAlgorithm = "imohash" + c.Options.HashAlgorithm = "xxhash" } log.Debugf("using hash algorithm: %s", c.Options.HashAlgorithm) if c.Options.NoCompress {