<FromGitter>
<confact> Does it exist a way for me to create a self-signed SSL or checking a certificate (expiration) and such? If not I will create an issue for that.
<jhass>
`openssl ...` :P
<jhass>
no I don't think we bind the necessary APIs yet
<jhass>
but I think there's a related issue already
<jhass>
not sure how usable https://github.com/datanoise/openssl.cr still is, there might be useful work in the forks and in general it might provide a base to work on
alexherbo2 has joined #crystal-lang
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 240 seconds]
absolutejam2 has quit [Ping timeout: 240 seconds]
<FromGitter>
<didactic-drunk> Are changes to openssl in crystal still accepted or is openssl moving to another shard?
<jhass>
I think we didn't really decide that yet
<jhass>
personally I would like to see certificate & key management APIs in stdlib
<hightower2>
yes yes, it's not about sorting, just prepending in order
<FromGitter>
<Daniel-Worrall> Ahj
absolutejam2 has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> I think you have to unshift, regardless
<FromGitter>
<ImAHopelessDev_gitlab> Good morning!!
sagax has quit [Ping timeout: 268 seconds]
absolutejam2 has quit [Ping timeout: 240 seconds]
absolutejam2 has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 265 seconds]
<FromGitter>
<confact> jhass: Thanks for pointing to that repo, it is closer to what i want but missing checking expiration as i can see. But it might be in source or something. Thanks!
<jhass>
hightower2: maybe don't use a constant if the value is not...
<hightower2>
it is constant, just depends on some values that are easier to construct separately than cram the lines right in the definition
<jhass>
you should be able to call a method from the constant initializer
<jhass>
Const = compute_const
<hightower2>
ah yes, clearly, that'd work
sagax has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> Either something is bugged in crystal alpine ssl, or something is bugged with this dockerfile
<FromGitter>
<Daniel-Worrall> Does anyone have a native alpine build?
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
duane has quit [Ping timeout: 265 seconds]
justinmcp has quit [Ping timeout: 246 seconds]
daemonwrangler has quit [Ping timeout: 245 seconds]
daemonwrangler has joined #crystal-lang
justinmcp has joined #crystal-lang
absolutejam2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
<FromGitter>
<christopherzimmerman> Are there every any plans with Crystal to allow overriding the `+=`, `*=`, etc... operators?
<jhass>
should already be possible, a op= b just expands to a = a op b
<oprypin>
jhass, i think the point is to make `+=` behavior special, e.g. actual mutation rather than reassignment of a new value
<jhass>
ugh, I hope we never do that
<jhass>
there's something like too much of that kind of stuff
<oprypin>
yea
<FromGitter>
<tenebrousedge> I don't really get why you would want to, and I'd probably hate seeing that in someone else's code
<FromGitter>
<Daniel-Worrall> Are http::client.exec's thread safe?
<jhass>
if not that's a bug!
<jhass>
but probably safer to not share multiple HTTP::Client instances across fibers for now, especially in multithread preview
<FromGitter>
<Daniel-Worrall> I'm having problems with reducing to find reproducible code, and some of it is in spawns.
<FromGitter>
<christopherzimmerman> In the numerical library I am working, like 50% of the clock time is spent duplicating data. A very common optimization is overriding those operators to treat mutation differently, rather than just using the expansion and re assigning.
<jhass>
and I see no reason to do it really, just make multiple to the same host
<FromGitter>
<Daniel-Worrall> It's not on MT for now though
<jhass>
yeah actually thinking about it you don't want to send more stuff to the server while waiting for a response
<jhass>
so better not share a HTTP::Client instance across fibers
<FromGitter>
<Daniel-Worrall> Hmm
<jhass>
that'll confuse things when the responses come in mixed
<jhass>
if not outright confusing the server
<FromGitter>
<Daniel-Worrall> Maybe I could mutex it
<jhass>
nah, just make more than one instance
<jhass>
if you use the class methods on HTTP::Client you should be good
<jhass>
what you're doing there exactly is not very clear from the question
<FromGitter>
<Daniel-Worrall> No I know
<FromGitter>
<Daniel-Worrall> I walked away from it a bit ago. I'll see if I can ask the right questions tomorrow
<jhass>
@christopherzimmerman I'm sure there's other ways to fix it :)
<jhass>
worst case going away from overriding standard operators etc and just useing plain old methods
<jhass>
I think we do some of that for the Big stuff?
<jhass>
mh, no looks like I'm wrong
<FromGitter>
<christopherzimmerman> Yea I have it exposed through other methods, but since itβs user facing it might be confusing that a += b is twice as slow as a.add(b, inplace: true)
<jhass>
just remove * etc? :)
yashko has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 265 seconds]
absolutejam2 has joined #crystal-lang
<Yxhuvud>
or define a + that is destructive, though that would probably surprise people too.
<Yxhuvud>
(also, considering the common performance problems using String#+=, I'm not certain it would be worse than the confusion that is inherent in += with allocating things)
yashko has quit [Quit: Leaving]
<FromGitter>
<didactic-drunk> Is there a quick way to `memzero` a `StaticArray`?
<FromGitter>
<didactic-drunk> Should `OpenSSL::Digest.clone` be `#clone` or `#dup`?
<hightower3>
Hey give me just a brief guideline here -- I need to open a binary file and then read bytes from it typically 1 or 2 bytes, little endian format. Which method should I use to open the file and read this type of data from it?