"Cryptographic" hash function I don't know much about the design of cryptographic hash functions but despite that I made an attempt for the sake of learning. This is what I got:

#include &lt;stdio.h&gt;

void hash(int* bits, int bitsLen, int* out, int outLen){
  const int tt[9] = {1,2,0,0,0,1,1,2,2};
  int st[128], i, k, j, y, a, b, o = 0;
  for (i=0; i&lt;128; ++i)
    st[i] = i%3;
  for (k=0; k &lt; bitsLen + outLen; ++k){
    for (j=0; j&lt;32; ++j){
      if (k &lt; bitsLen)
        st[0] = bits[k];
      for (i=j%2; i&lt;128; i+=2){
        y = (i+1)%128;
        a = st[i];
        b = st[y];
        st[i] = tt[a*3+b];
        st[y] = tt[b*3+a];
      };
    };
    if (k &gt;= bitsLen)
      out[o++] = (st[0] + st[1]*3 + st[2]*9 + st[3]*27) % 2;
  };
}

void printHex(int* bits, int bitsLen){
  int i;
  for (i=0; i&lt;bitsLen/4; ++i)
    printf("%x", bits[i*4+0]*8+bits[i*4+1]*4+bits[i*4+2]*2+bits[i*4+3]);
}

void toBits(int n, int* bits, int bitsLen){
  int i;
  for (i=0; i&lt;bitsLen; ++i)
    bits[bitsLen-i-1] = (n &gt;&gt; i) &amp; 1;
}

int main(){
  const int bitsLen = 16;
  int bits[bitsLen];

  const int outLen = 256;
  int out[outLen];

  int i;
  for (i=0; i&lt;256; ++i){
    toBits(i, bits, bitsLen);
    hash(bits, bitsLen, out, outLen);
    printHex(bits, bitsLen);
    printf(": ");
    printHex(out, outLen);
    printf("\n");
  };
}


This passes my (certainly lacking) criteria. I'd like to know what are the weaknesses of this function and how it could be exploited if actually used to replace, say, SHA3 in a cryptographic application that requires collision-resistance, non-reversibility and so on.
First you need to read Schneier's Memo to the Amateur Cipher Designer.  All amateur cryptography is faulty, not just yours.  I too designed a cryptographic hash, based round RC4, put it out on the web and Scott Fluhrer was kind enough to show me the obvious faults in it.  He is an expert, so he knew what to look for.  I was not and I did not know what I had to protect against.  Our conversation is probably still out there on the sci.crypt Usenet group from 2007.

To design a good hash function you need to know the types of attacks that are used against hashes.  For example, does your hash specifically guard against length-extension attacks?

How fast is your hash compared to other current cryptographic hashes such as SHA3?

For a first suggestion, learn how cryptographic hashes pad their input and why.  Either incorporate the same technique into your hash or else find a different way to serve the same purpose.  You are not the first person to write a hash.  Learn so you can stand on the shoulders of giants.