Both has their advantages and disadvantage. Hashing will not store password as the text itself unlike some encryption scheme where the password after processed with the encryption key , are sometimes stored still as text after decryption. and would have vulnerabilities when the encryption key is stolen. Hashing is another method where the database stores only the hash equivalent of the password or credentials. When it comes to data visibility and security hashing would top encryption.