Hashing and Encryption are a little bit of the same thing. They serve the same purpose. That is a secure transmission of data between the sender and receiver.
The big difference between both is that in hashing you can’t reverse the process for retrieval of the un-hashed original string but in encryption, you can. Hashing is like a one-way encryption which is an irreversible process that’s why it is termed to be one-way.