arrow_backफ़ील्ड नोट्स पर वापस जाएँ
COMPUTER SCIENCE प्रकाशित 5 Aug 2026

Binary, Hex, और Data Units समझाया गया

Programming, networking, और forensics work में उपयोग की जाने वाली binary, hexadecimal, और data unit conventions की एक व्यावहारिक glossary।

हर byte जो आप hex editor में inspect करते हैं, हर subnet mask जो आप calculate करते हैं, हर file size जो कोई tool report करता है — ये सब कुछ number systems और unit conventions के एक छोटे से set पर निर्भर करता है। अगर ये गलत हो जाएं तो आप buffer size का गलत अंदाजा लगाएंगे, memory dump को गलत पढ़ेंगे, या किसी colleague के साथ argue करेंगे कि 1 KB, 1000 bytes है या 1024 bytes।

Binary: base जो हर computer actually बोलता है

Binary base 2 है — सिर्फ 0 और 1। एक binary digit को bit कहते हैं। 8 bits को एक साथ group करो तो आपको byte मिलता है, जो 256 distinct values represent कर सकता है (0 से 255 unsigned, या -128 से 127 signed two's complement)।

जब आप 01001000 देखते हो तो वह decimal में 72 है, जो 'H' का ASCII code है। Hand से convert करना सिर्फ rightmost bit से powers of 2 को sum करना है: 2^6 + 2^3 = 64 + 8 = 72। Tools जैसे python3 -c "print(bin(72))" या xxd file पर ये instantly करेंगे, लेकिन math को समझना important है जब आप bitmask को reverse engineer कर रहे हो या TCP header में flag values निकाल रहे हो।

Hexadecimal: binary का shorthand

Hex base 16 है, 0-9 और A-F use करता है। यह exist करता है क्योंकि binary बड़े scale पर unreadable है और decimal cleanly byte boundaries से map नहीं होता। एक hex digit exactly 4 bits represent करता है, इसलिए दो hex digits एक full byte represent करते हैं — 0x00 से 0xFF सभी 256 byte values को cover करता है कोई wasted space नहीं।

यह है कि hex dumps xxd, hexdump -C, या disassembler के memory view में default क्यों हैं। जब आप किसी file की शुरुआत में 0x4D 0x5A देखते हो, वह MZ header है जो Windows PE executable को identify करता है। Memory addresses, color codes (#FF5733), MAC addresses, और IPv6 addresses सभी conventionally hex में लिखे जाते हैं क्योंकि यह underlying byte और nibble structure से बिल्कुल cleanly map होता है।

Hex को decimal में convert करना: 0x4D = (4 × 16) + 13 = 77। Python में, int('4D', 16) आपको hand math के बिना वहां ले जाता है, और hex(77) दूसरी तरफ जाता है।

जहां binary, decimal, और hex actually practice में मिलते हैं

IP addresses एक अच्छा उदाहरण है जहां सभी तीनों टकराते हैं। 192.168.1.1 जैसा IPv4 address वास्तव में चार bytes हैं: binary में 11000000.10101000.00000001.00000001, या hex में C0.A8.01.01। Subnetting math — यह पता लगाना कि क्या दो addresses एक ही network पर हैं — fundamentally binary AND operations हैं subnet mask के विरुद्ध, भले ही हम सब कुछ convenience के लिए dotted decimal में लिखते हों।

Digital forensics और malware analysis में, आप लगातार इन representations के बीच translate कर रहे होते हो। एक disassembler opcodes को hex में दिखाता है, लेकिन CPU raw binary को execute करता है, और register values अक्सर decimal offsets या ASCII strings के रूप में interpret होते हैं context के आधार पर। यह जानना कि 0x41 दोनों ही 65 है और ASCII character 'A' है — यह pattern recognition का एक ऐसा तरीका है जो manual analysis को substantially faster बनाता है।

Data units: 1000 vs 1024 समस्या

यह वह जगह है जहां लोग वास्तव में प्रभावित होते हैं। Storage manufacturers, filesystems, और operating systems हमेशा agree नहीं करते कि

AI सहायता से लिखा गया, माइकल पिल्च (CISSP), Korra Studio द्वारा समीक्षित और प्रकाशित।

आगे बढ़ने के लिए तैयार?

यह Korra Studio के ज्ञान आधार से एक नोट है — प्लेटफ़ॉर्म हर विषय को 1-टू-1 मेंटरिंग के साथ जोड़ता है।

मुफ़्त शुरू करेंarrow_forward