1) One who steals from a large number of people (e.g. if he was a shopkeeper and sold with faulty weights etc.) or if he was appointed to look after the money of the congregation and he was lenient with his relatives and severe and strict with other people or if he lent to many people and charged interest and does not know to whom he should return the money, he should use the money for things which everyone needs in a way that it is logical to assume that those from whom he stole will also derive benefit from it (examples of this are to donate holy books to a central synagogue or to donate money to a charitable organisation from which everyone derives benefit.). (Kitzur Shulchan Aruch 182)
2) However, this method of repaying his thefts is only effective to those people whose identity he genuinely does not know. However, people who he knows that he stole from, must have their money returned to them directly. (ibid)

