cs1a.js
function fold(count, buf)
{
  if(!count || buf.length % 2) return buf;
  var ret = buf.slice(0,buf.length/2);
  for(i = 0; i < ret.length; i++) ret[i] = ret[i] ^ buf[i+ret.length];
  return fold(count-1,ret);
}
function fold(count, buf)
{
  if(!count || buf.length % 2) return buf;
  var ret = buf.slice(0,buf.length/2);
  for(i = 0; i < ret.length; i++) ret[i] = ret[i] ^ buf[i+ret.length];
  return fold(count-1,ret);
}
function fold ( count , buf ) { if ( ! count || buf . length % 2 ) return buf ; var ret = buf . slice ( 0 , buf . length / 2 ) ; for ( i = 0 ; i < ret . length ; i ++ ) ret [ i ] = ret [ i ] ^ buf [ i + ret . length ] ; return fold ( count - 1 , ret ) ; }
simple xor buffer folder
simple xor buffer folder