Y u no Mamaleek

  • 0 Posts
  • 46 Comments
Joined 25 days ago
cake
Cake day: November 3rd, 2025

help-circle






  • This here is the implementation of sha256 in the slow language JavaScript:

    const msgUint8 = new TextEncoder().encode(message);
    const hashBuffer = await window.crypto.subtle.digest("SHA-256", msgUint8);
    const hashHex = new Uint8Array(hashBuffer).toHex();
    

    You imagined that JS had to have that done from scratch, with sticks and mud? Every OS has cryptographic facilities, and every major browser supplies an API to that.

    As for using it to filter out bots, Anubis does in fact get it a bit wrong. You have to incur this cost at every webpage hit, not once a week. So you can’t just put Anubis in front of the site, you need to have the JS on every page, and if the challenge is not solved until the next hit, then you pop up the full page saying ‘nuh-uh’, and probably make the browser do a harder challenge and also check a bunch of heuristics like go-away does.

    It’s still debatable whether it will stop bots who would just have to crank sha256 24/7 in between page downloads, but it does add cost that bot owners have to eat.


  • I mean, I thought it was long dead. It’s twenty-five years old, and the web has changed quite a bit in that time. No one uses Perl anymore, for starters. I used Open Web Analytics, Webalizer, or somesuch by 2008 or so. I remember Webalizer being snappy as heck.

    I tinkered with log analysis myself back then, peeping into the source of AWStats and others. Learned that a humongous regexp with like two hundred alternative matches for the user-agent string was way faster than trying to match them individually — which of course makes sense seeing as regexps work as state-machines in a sort of a very specialized VM. My first attempts, in comparison, were laughably naive and slow. Ah, what a time.

    Sure enough, working on a high-traffic site taught me that it’s way more efficient to prepare data for reading at the moment of change instead of when it’s being read — which translates to analyzing visits on the fly and writing to an optimized database like ElasticSearch.










  • Wine has some compatibility differences between its versions — I’ve had to downgrade it before because the newer version didn’t work with the app I wanted. So, if you’re ever in the mood to try again, you could check out an older version, and perhaps try launching a simpler app like notepad which is iirc supplied with Wine.

    Also, Wine launched from the command line, with the exe as the parameter, usually prints a lot of stuff some of which may say what libraries weren’t found, and winetricks allows installing those libraries easily (if it’s still around, I haven’t done this in a while). Typically something like ‘MS C++ redistributables’ or the .NET framework is necessary.