Quick Implementation of a weird hashing function