1830, from Pennsylvania Ger. hexe "to practice witchcraft," from Ger. hexen "to hex," related to Hexe "witch," from M.H.G. hecse, hexse, from O.H.G. hagazussa (see hag). Noun meaning "magic spell" is first recorded 1909.
n. 1. Short for hexadecimal, base 16. 2. A 6-pack of anything (compare quad, sense 2). Neither usage has anything to do with magic or black art, though the pun is appreciated and occasionally used by hackers. True story: As a joke, some hackers once offered some surplus ICs for sale to be worn as protective amulets against hostile magic. The chips were, of course, hex inverters.