The ん negative ending is a contraction of sorts of classical negative ending ぬ, precursor to modern ない. It's still pretty common. As illustration of this, the Microsoft IME gives 食べん as a valid conversion option after typing in taben, or 飲まん for noman.
Note that する with the negative ん is not しん, but instead せん, as again the negative ん is from classical ぬ, and the classical negative form of する is せぬ.
(蛇足: I think this せん was another layer of pun in the shortened name of the title character in Spirited Away.)
In addition, the ん in the polite negative ending ません is this same ぬ > ん contraction. ます for the most part conjugates in a similar way as する, with the classical negative ませぬ.
Occasionally, modern ない itself will contract to just ん without coming from the classical ぬ, as in the common informal contraction じゃん from ではない, or as in the なかった > んかった shift mentioned in the question. As a verb ending, though, negative ending ん is usually from classical negative ぬ.
Edit:
じゃん is sometimes explained as a contraction of ではない, where では becomes じゃ and ない becomes ん. Phonologically, the first half is well-established and accepted where で + は shifts to じゃ, but the ない > ん shift remains unexplained. A more likely sound shift would be based on the older phrases ではあらぬ or ではあらむ. あらぬ aranu is the older verb-based version of modern negative ない nai, meaning "[there | it] isn't", while あらむ aramu with an m sound is the older version of modern presumptive あろう arō, meaning "isn't [there | it]", confirming with the listener.
Semantically, modern じゃん is used either in a negative sense, or in a confirmation sense, matching these two older verb forms.
Phonetically, both あらぬ and あらむ were known to contract to あらん aran. So ではあらぬ / ではあらむ > じゃあらん. The corruption of -あらん to -あん can be observed in the slang of some modern speakers, such as 分からん > 分かん. So じゃあらん > じゃん.
So ultimately, I don't think there is any diachronic (i.e. historical) foundation for ない itself turning into ん directly. Instead, we see the precursor to ない, classical ぬ, turning into ん via clearly observable contraction processes.