Python Hash Function For Pools