From the course: Symmetric Cryptography Essential Training
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Integers
From the course: Symmetric Cryptography Essential Training
Integers
- [Instructor] Integers are whole numbers and are often stored in 1, 2, 4, or 8 bytes. I've written a short program for you to play with that demonstrates how integers are represented in memory. This is important to know because they're not always represented the same across different computers. Before we get to the program though, let's talk about the differences between the ways integers are represented. The first option is Big Endian. Big Endian means that the most significant bits are first in memory. The other option is Little Endian, which means that the least significant bits are the first in memory. Little Endian is how integers are represented on Intel and AMD processors, and ARM processors default to it, so it's easily the most common representation, but it's not universal. For an example, let's take a 32-bit integer, so four bites storing the value one that looks different in Big Endian and Little Endian. With Big Endian, the one ends up in the last byte, as you see here…