crypt.js
function(n) {
      // If number given, swap endian
      if (n.constructor == Number) {
        return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
      }

      // Else, assume array and swap all items
      for (var i = 0; i < n.length; i++)
        n[i] = crypt.endian(n[i]);
      return n;
    }
function(n) {
      // If number given, swap endian
      if (n.constructor == Number) {
        return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
      }

      // Else, assume array and swap all items
      for (var i = 0; i < n.length; i++)
        n[i] = crypt.endian(n[i]);
      return n;
    }
function ( n ) { // If number given, swap endian if ( n . constructor == Number ) { return crypt . rotl ( n , 8 ) & 0x00FF00FF | crypt . rotl ( n , 24 ) & 0xFF00FF00 ; } // Else, assume array and swap all items for ( var i = 0 ; i < n . length ; i ++ ) n [ i ] = crypt . endian ( n [ i ] ) ; return n ; }
Swap big-endian to little-endian and vice versa
Swap big - endian to little - endian and vice versa