Factory hammers quickly begin to "fly off" and strengthen it is very problematic, as a metal plate wedge is clogged. Have to file down at the base of the hammer and plant on a new one. The 1st method is useful here to secure the hammer securely. In the handle, we drill a groove with a diameter of 7-8 mm, depending on the size of the hammer, and into it we hammer a round wedge of 1-2 mm with a large diameter. In order for the wedge to "not fluff up" when driving, its impact part must be rounded with a knife. One or two of these wedges will fix your hammer for a long time. In the future, you can (if loose) again add a wedge.
The 2nd method is also good and very simple, it’s in a hurry. The only minus hammer will still "slander", but will not "fly off". Here you need a washer exciting part of the hammer and a long screw.