“The man who does evil against another harms himself.”
οἷ αὐτῷ κακὰ τεύχει ἀνὴρ ἄλλῳ κακὰ τεύχων
Perhaps (Plato’s) Socrates was thinking of this when he said “doing wrong is worse than suffering it“.
Of course, Hesiodic poetry is not always consistent (Fr. 286):
“If someone sows wrongs, he will reap wicked profits.
If he suffers what he has wrought, now that is straight justice.”
εἰ κακά τις σπείραι, κακὰ κέρδεά <κ’> ἀμήσειεν·
εἴ κε πάθοι, τά τ’ ἔρεξε, δίκη κ’ ἰθεῖα γένοιτο
But this description is not completely opposed to the first: one is about personal morality and the other is about a wish for punishment for someone else.
This eye-for-an-eye take on justice is one of the traditional notions epic poetry investigates and Plato’s interlocutors debate. Another, also from Plato, is the idea that justice is relative, merely the hegemonic privilege of those in power.