Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Rust Standard Library Cookbook

You're reading from   Rust Standard Library Cookbook Over 75 recipes to leverage the power of Rust

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher Packt
ISBN-13 9781788623926
Length 360 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Jan Hohenheim Jan Hohenheim
Author Profile Icon Jan Hohenheim
Jan Hohenheim
Daniel Durante Daniel Durante
Author Profile Icon Daniel Durante
Daniel Durante
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Learning the Basics FREE CHAPTER 2. Working with Collections 3. Handling Files and the Filesystem 4. Serialization 5. Advanced Data Structures 6. Handling Errors 7. Parallelism and Rayon 8. Working with Futures 9. Networking 10. Using Experimental Nightly Features 11. Other Books You May Enjoy

Getting ready

In this chapter, we are going to talk about endianness. It is a way of describing how the values in a buffer are ordered. There are two ways to order them:

  • Put the smallest one first (Little Endian)
  • Put the biggest one first (Big Endian)

Let's try an example. Suppose we wanted to save the hexadecimal value 0x90AB12CD. We first have to split it into bits of 0x90, 0xAB, 0x12, and 0xCD. We now can either store them with the biggest value first (Big Endian), 0x90 - 0xAB - 0x12 - 0xCD, or we could write the smallest number first (Little Endian), 0xCD - 0x12 - 0xAB - 0x90.

As you can see, it's the exact same set of values, but flipped. If this short explanation left you confused, I advise you to look at this excellent explanation by the University of Maryland's Department of Computer Science: https://web.archive.org/web/20170808042522/http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/endian.html.

There is no better endianness. Both are used...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image