News for hackers. Stuff that matters.
Re:SEPA: A Simple, Efficient Permutation Algorithm by scj on Sunday September 23, 2018 @07:42PM (#18053987)
Why would a==b be a problem with the XOR swap trick?

  function xorSwapTest(min, max) {
    for (var i = min; i < max; i++) {
      var a = i, b = i;
      b ^= a;
      a ^= b;
      b ^= a;

      if (a != i || b != i)
        throw Error("Problem with " + i);
      }

    return true;
  }
Re:SEPA: A Simple, Efficient Permutation Algorithm by saagarjha on Sunday September 23, 2018 @08:46PM (#18054241)
The issue is that if a == b, &s[a] == &s[b]; i.e. you're writing to the same address.