Hex
''Hex'' is an ambiguous term that may refer to various concepts in different fields, including games, folklore, computing, engineering, places, businesses, and arts. For specific meanings, see the relevant sections below.Folklore and Magic
As a Curse or Spell
In folklore, a hex refers to a malevolent spell or curse intended to bring misfortune, illness, or death upon a target, often attributed to witchcraft practices. The term derives from the Pennsylvania German word hexe, meaning "to practice witchcraft," which entered American English around 1830 through immigrant communities from the Palatinate region of Germany.[1] This usage reflects a broader European tradition of sorcery but became distinctly associated with Pennsylvania Dutch (Deutsch) settlers who blended Old World beliefs with New World rural life. Unlike neutral or protective magic, a hex was viewed as manipulative and harmful, sometimes involving the invocation of supernatural forces to alter behavior or cause physical harm.[2] Historical accounts from Pennsylvania German and Appalachian folklore describe hexing as a feared practice that could afflict individuals or families with unexplained ailments, crop failures, or livestock deaths. In 19th-century rural Pennsylvania, beliefs in hexing were widespread among Dutch communities, where it was thought that a practitioner—known as a hexer or witch—could impose suffering through ritual acts such as verbal incantations drawn from folk grimoires or the use of poppets (small effigies) to represent and harm the victim. For instance, the 1820 publication The Long Lost Friend by Johann George Hohmann, a key text in Pennsylvania German folk magic, included incantations that could be adapted for both healing and cursing, illustrating how hexing rituals often mirrored protective ones but with inverted intent.[3] In Appalachian traditions, influenced by German settlers, hexing tales emphasized misfortune as a form of retribution, such as a neighbor's curse causing chronic illness, reinforcing community vigilance against suspected witches.[4] Hexing held significant cultural roles in practices like Braucherei (powwowing), a Pennsylvania Dutch healing tradition that countered hexes through prayers and charms, though the term hex itself connoted malevolence and was distinct from benevolent Brauchers.[5] In hoodoo, an African American folk magic system with European overlaps, hexing involved similar cursing techniques using roots, powders, or verbal spells to jinx enemies, often as a means of resistance in rural Southern communities.[6] Modern Wicca has reinterpreted hexing as ethical spellwork, emphasizing personal responsibility to avoid harm, though traditional views persist in some folk circles. A notorious example is the 1928 "Hex Murder" in York County's Rehmeyer's Hollow, where three men, convinced they were hexed by folk healer Nelson Rehmeyer, killed him in a ritualistic attempt to break the supposed curse by burning his hair and book of spells; the case highlighted the persistence of these beliefs into the 20th century.[7] Sociologically, hex beliefs in rural Pennsylvania and Appalachian communities served as mechanisms of social control, scapegoating outsiders or rivals during times of hardship like economic downturns or epidemics, thereby maintaining group cohesion through shared supernatural explanations.[8] Psychologically, these convictions fostered anxiety and reinforced fatalistic worldviews, where misfortune was externalized to witches rather than addressed through rational means, as evidenced in studies of witchcraft accusations disrupting social relations in isolated areas.[9] Such interpretations underscore hexing's role not just as superstition, but as a cultural framework for navigating uncertainty in agrarian societies.[10]Hex Signs and Symbols
Hex signs, a distinctive form of Pennsylvania Dutch folk art, were introduced by German-speaking immigrants who settled in southeastern Pennsylvania during the 18th and 19th centuries. These settlers drew inspiration from European traditions, including sgraffito techniques and decorative barn stars from Swiss and German alpine regions, adapting them to adorn barns, homes, and household items as vibrant, circular murals.[11] The designs evolved from practical agricultural decorations into a recognized art form by the mid-19th century, with the earliest documented barn star dating to 1819 near Lenhartsville.[12] The popularization of "hex signs" as a term occurred in the 1920s, fueled by tourist interest and artists such as Johnny Ott, who began commercializing portable versions in the 1940s and 1950s, blending traditional motifs with marketed narratives of symbolism.[11] Central to hex sign designs are symbolic motifs that convey wishes for prosperity and protection, often arranged in geometric patterns within a circular frame. Common elements include hearts representing love and romance, multi-pointed stars symbolizing protection and celestial guidance (such as six-pointed stars for the days of creation or eight-pointed ones for fertility), birds like the distelfink (a stylized goldfinch evoking the soul, happiness, and perseverance), and tulips denoting faith and renewal.[12] Colors enhance these meanings, with red signifying strong emotion and vitality, green evoking life and fertility, and blue denoting spiritual strength and harmony; patterns such as sunbursts, raindrops, and floral borders further emphasize themes of abundance and the natural cycles of agriculture.[11] In Pennsylvania Dutch culture, hex signs function primarily as decorative emblems of good fortune and ethnic pride, painted on barns to celebrate farmsteads rather than to invoke supernatural powers, though early misconceptions linked them to warding off evil.[12] Throughout the 20th century, they transitioned into commercial folk art, with scholars cataloging over 200 traditional variations that incorporate universal symbols like eagles for strength and oaks for endurance.[13] Today, hex signs are preserved through institutions like the Pennsylvania German Cultural Heritage Center at Kutztown University, which maintains exhibitions, folklife presentations, and documentation of barn star traditions to safeguard this heritage.[13] Modern applications appear in home decor, business logos, and cultural events, including the annual Kutztown Folk Festival, where artists such as Eric Claypoole demonstrate painting techniques and showcase evolving designs that blend historical motifs with contemporary aesthetics.[12]Computing and Mathematics
Hexadecimal Numeral System
The hexadecimal numeral system, also known as base-16, is a positional numeral system that employs sixteen distinct symbols to represent numerical values. It uses the decimal digits 0 through 9 for values zero to nine, and the letters A through F (case-insensitive, where A=10, B=11, C=12, D=13, E=14, F=15) for values ten to fifteen.[14] Each position in a hexadecimal number represents a power of 16, starting from the rightmost digit as $16^0. This structure allows compact representation of binary data, as each hexadecimal digit corresponds exactly to four binary digits (a nibble), since $16 = 2^4.[15] The concept of a base-16 system traces back to the 17th century, when Gottfried Wilhelm Leibniz described it as "sedecimal" in his writings on binary arithmetic. In the 19th century, Thomas Wright Hill proposed a practical base-16 system in 1845, dubbing it "sexdecimal," while John William Nystrom advocated for it in 1862 under the name "tonal" with custom symbols. Its adoption in computing began in 1950 with the U.S. National Bureau of Standards' Standards Eastern Automatic Computer (SEAC), which used 0-9 and A-F for machine instructions. The term "hexadecimal" first appeared in a 1954 newsletter describing the Miniac computer, though its use was already established by then. IBM further standardized the 0-9 and A-F notation in 1964 with the System/360 mainframe, popularizing it across computing platforms due to the architecture's byte-oriented design.[14][16] To convert a decimal number n to hexadecimal, repeatedly divide n by 16 and record the remainders, which form the digits from least to most significant; alternatively, the k-th digit d_k (starting from k=0 for the least significant) is given by d_k = \left\lfloor \frac{n}{16^k} \right\rfloor \mod [16](/page/16). For example, the decimal number 255 converts to hexadecimal FF: $255 \div [16](/page/16) = 15 remainder 15 (F), and $15 \div [16](/page/16) = 0 remainder 15 (F). A byte (8 bits) is thus represented by exactly two hexadecimal digits, ranging from 00 to FF, which spans 0 to 255 in decimal.[14] In computing and mathematics, hexadecimal offers advantages over binary by providing a more human-readable and compact notation for large binary values, reducing errors in manual transcription. It is widely used for memory addresses, where locations are denoted in hex (e.g., 0x7FFF for a 16-bit address). In programming languages like C++, hexadecimal literals are prefixed with 0x, such as 0xFF for 255. Additionally, in web development, hexadecimal specifies colors in HTML and CSS via the #RRGGBB format, where RR, GG, and BB represent red, green, and blue intensities from 00 to FF, as defined in the CSS Color Module.[15][17]Hexadecimal File Formats
Hexadecimal file formats encode binary data, such as machine code or firmware, into human-readable ASCII text using hexadecimal digits, facilitating transmission and storage in environments like serial communications or text-based systems. These formats emerged in the 1970s to support programming microcomputers and embedded devices, where direct binary transfer was impractical due to error-prone media like paper tape or teletypes. The most prominent is the Intel HEX format, developed by Intel in 1973 for its Intellec Microcomputer Development Systems to load and execute programs from mass storage.[18] The Intel HEX format consists of records, each beginning with a colon (:) followed by fields in two-digit hexadecimal pairs: byte count (number of data bytes), address (load offset), record type, data bytes, and a checksum (two's complement of the sum of all preceding bytes modulo 256). Record types include 00 for data records carrying the primary payload, 01 for end-of-file (EOF), 04 for extended linear address (setting upper 16 bits of a 32-bit address), and others like 02 for extended segment address in legacy 16-bit systems. For instance, a sample data record:100000000102030405060708090A0B0C0D0E0F1068 specifies 16 bytes (10 hex) at address 0000, with data from 01 to 10, and checksum 68 verifying integrity by ensuring the sum of all bytes (excluding the colon) equals zero modulo 256. Parsing involves reading lines sequentially, updating the current address based on extended records, and writing data to memory at the specified offsets until the EOF record.[19][18]
Other notable formats include the Motorola S-record, introduced by Motorola in the mid-1970s for encoding object files in printable ASCII, particularly for microprocessor loaders. Similar to Intel HEX, it uses records starting with 'S' followed by type (e.g., S1 for 16-bit address data, S3 for 24-bit, S7 for 32-bit start address), byte count, address, data, and checksum (two's complement of the sum excluding the type and count). Key differences from Intel HEX include variable line lengths up to 78 bytes (versus Intel's flexible but often shorter lines), no colon prefix, and support for header records (S0) for module names, making it suited for firmware uploads to devices like GPS units or robots. The Digital Research HEX format, used in CP/M systems for 8086 processors, extends the Intel HEX structure by adding record types to distinguish code, data, stack, and extra segments, enabling segmented addressing in early 16-bit environments without altering the core checksum or line format.[20][21]
These formats are primarily used in embedded systems for loading firmware into ROMs or flash memory via programmers, and for debugging binary files by representing raw data in a text-editable form. Tools such as the HxD hex editor allow viewing and modifying these files, displaying both hexadecimal and ASCII representations to aid reverse engineering or patching. In practice, a binary executable is converted to Intel HEX (e.g., using utilities like objcopy), transferred serially, and parsed by the target device's bootloader to populate memory regions.[22]
Over time, Intel HEX evolved to handle larger address spaces, with the 1978 addition of types 02 and 03 for 8086 segmented addressing, and later type 04 (around the 1990s) for 32-bit linear addressing in extended linear address records, supporting up to 4 GB without segmentation. This adaptation accommodated microcontrollers exceeding 64 KB, such as those from Microchip or ARM, though 64-bit extensions remain non-standard and vendor-specific. Motorola S-records similarly progressed to S3 and S7 types for 24- and 32-bit addressing. These updates ensured compatibility with modern embedded applications while preserving backward compatibility for legacy systems.[23][19]