Split of hash sanitation and added tests