Sort:  

In an exchange you put the funds in an "order book" and the exchange "matches" your order by using its liquidity. It also charges you for withdrawals. In a swap, you agree with a counterparty to exchange funds, without any commission, at a price agreed by both of you.

Since hashing should still be done in case of a swap too, where is it done?

This comment has received a 5.88 % upvote from @upgoater thanks to: @fersher.