hash class implementation