Maja changed the topic of ##bash-crimes to: we bash back | club of folks preoccupied in whether they could, not whether they should | logs https://libera.irclog.whitequark.org/~h~bash-crimes
<janvhs> Sooo the array implementation from yesterday… I wrote a test suite for it and iterated the design a bunch. New version now lives at https://git.sr.ht/~janvhs/sh
<JAA> Ugh, Sourcehut has also deployed Anubis now. :-(
<JAA> Looks beautifully cursed :-)
<janvhs> JAA: yeah they struggled a bunch with AI crawlers
<janvhs> Ironically the thing I’m most hyped about right now is my expect_equal function because it’s so delightful for debugging
<JAA> Yeah, I saw Drew's rant about it the other day, and I've been struggling, too. I just hate the JS challenge approach with a passion.
<janvhs> I think the dev would have loved a simpler solution too… I don’t know the wording but she mentions even that it’s an incredibly overkill approach to the problem, but the prove-of-work challenge is only thing that seems to work reliably. AI crawlers don’t respect robots.txt, lie about their user agent and try to blend in. I guess you could do server side request pattern tracking, but that’s
<janvhs> a cat and mouse game and would probably require GDPR agreement
<janvhs> I’m just happy GNOME, KDE and sr.ht found a way to have their infra back without AI driving up costs
mei[m] has joined ##bash-crimes
<mei[m]> okay, just for shits and giggles: can any of you think of some way of doing constant-time computation within bash? i think that'd be funny :3
<misentropy> bash5 has $EPOCHREALTIME fwiw
<mei[m]> <misentropy> "bash5 has $EPOCHREALTIME fwiw" <- i think that's a different thing. i'm talking about like, cryptographic computations resistant to side-channels
<misentropy> oic
<misentropy> good luck
<isabella> If you mean things like memcmp(foo, bar, n) but constant time, in c this usually means always doing n comparisons and setting a flag to check at the end of the calculation
<isabella> Like c |= foo[k] == bar[k]
<isabella> You can do that in bash too
<isabella> In that particular case I'd just make sure to pad both strings so they are at least n characters long
<mei[m]> i mean first of all, (( a = b + c )) is not constant time because bash is stringly-typed lmfao
<JAA> janvhs: There's no reason the PoW challenge can't have a non-JS fallback, for example. A couple implementations do, but most don't. But even before it needs to get to that, there are other options. Personally, I'd rather explore those before making life harder for my legitimate users.