add Hash class which works for PHP5.4 as well.