bug in key

Added php docs and corrected a bug in key when hashing without