I think once you get the hardware into a slide, counting and getting them to a package is the easy part. It is the initial sorting and getting them to the slide that is not easy. I thought it would be.
This was my last attempt. The vibrator plate was loaded and would turn on when need to slowly load the plate. The plate had all sorts of attachments to arrange and space the hardware (worked with M2.5 all the way up to the 5/16x1 1/2"). Once everything faced the right way and had a bit of space to them they were kicked out over the sensor and counted. I had a web app that counter teh current number of items, and total number of bags counted, and it would stop when I hit the goal on both. for certain things it worked pretty well, for others the error was unpredictable. I tried 5 or more different sensors and all sorts of different chute designs. It has finicky. You could also pretty easily get hardware jams on the plate.