[go-nuts] Re: strange failure of golang.org/x/crypto/argon2.IDKey

2020-01-03 Thread Ren Thraysk
Memory parameter to IDKey is in kilobytes. Your code is specifying 200 kilobytes. Ren On Friday, 3 January 2020 07:14:22 UTC, andre@gmail.com wrote: > > > I attached a minimal test program to reproduce an issue with > golang.org/x/crypto/argon2. > > It calls IDKey twice with the same p

Re: [go-nuts] Re: [64]byte()[:]

2019-11-17 Thread Ren Thraysk
Or look at the source of bytes.Equal() first. :) https://golang.org/src/bytes/bytes.go?s=505:533#L8 Ren On Sunday, 17 November 2019 17:54:47 UTC, Kevin Malachowski wrote: > > Good call, I don't know why I didn't think of the stack allocation. > > The conversion to string first is also quite in

[go-nuts] Re: [64]byte()[:]

2019-11-17 Thread Ren Thraysk
Trick is knowing the compiler can optimize string(b) away. const z8 = "\x00\x00\x00\x00\x00\x00\x00\x00" const z64 = z8 + z8 + z8 + z8 + z8 + z8 + z8 + z8 if string(b64) == z64 { } Ren On Saturday, 16 November 2019 03:32:32 UTC, Gert wrote: > > Is it possible to write this without creating a

[go-nuts] Etiquette on reusing test code

2017-07-31 Thread Ren Thraysk
Wondering what the etiquette is for using test code from other packages, both from golang stdlib and /x/ ? Obviously the BSD like license stays, but is there an expected way of documenting the tests are modified versions written by other parties? Ren -- You received this message because you ar

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-06 Thread Ren Thraysk
On Tuesday, 6 June 2017 13:46:58 UTC+1, venturestre...@gmail.com wrote: > > On a complete tangent, are you calling a stored procedure there? I thought > the database/sql package didn't support MySQL stored procedures yet? > Haven't encountered a serious issue, as yet. Obviously output paramete

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-05 Thread Ren Thraysk
Wrote something similar recently. One difference is that I moved the rows.Scan call into the passed in function. type Scannable interface { Scan(...interface{}) error } func scanIntoUser(u *store.User) func(s Scannable) error { return func(s Scannable) error { return s.Scan(&u.Id, &u.Name