Node.js by Example

Bits

A bit is the basic unit of information in computing and digital communications usually expressed as 0 (Zero) or 1 (One). The word bit is short for binary digit. Binary means there are two options e.g: true/false, 0/1 or on/off

Counting in Binary (bits)

Starting at Zero, the first 16 numbers in Binary are:

+---+---+----+----+-----+-----+-----+-----+------+------+------+------+------+------+------+------+
| 0 | 1 |  2 |  3 |   4 |   5 |   6 |   7 |    8 |    9 |   10 |   11 |   12 |   13 |   14 |   15 |
+---+---+----+----+-----+-----+-----+-----+------+------+------+------+------+------+------+------+
| 0 | 1 | 10 | 11 | 100 | 101 | 110 | 111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
+---+---+----+----+-----+-----+-----+-----+------+------+------+------+------+------+------+------+

Did you spot the pattern(s)? If not, I suggest you read up on counting binary: http://en.wikipedia.org/wiki/Binary_number

watch: https://www.youtube.com/watch?v=VBDoT8o4q00 (how computers count)

Bytes

A byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits.

Hello! in Binary (8-Bit ASCII)

01001000 01100101 01101100 01101100 01101111 00100001
    H        e        l        l        o        !

Try it: http://text2binary.herokuapp.com/

Hexadecimal

Hexadecimal

In mathematics and computing, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a–f) to represent values ten to fifteen.