<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bytes on rustbites</title><link>https://www.rustbites.com/tags/bytes/</link><description>Recent content in Bytes on rustbites</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 07 Jul 2026 09:38:34 +0200</lastBuildDate><atom:link href="https://www.rustbites.com/tags/bytes/index.xml" rel="self" type="application/rss+xml"/><item><title>240. to_le_bytes / from_le_bytes — Serialize Integers Without unsafe or Bit-Shifting</title><link>https://www.rustbites.com/posts/bite-240/</link><pubDate>Sat, 04 Jul 2026 17:00:00 +0100</pubDate><guid>https://www.rustbites.com/posts/bite-240/</guid><description>&lt;p&gt;Packing a &lt;code&gt;u32&lt;/code&gt; into four bytes by hand means a stack of &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; and &lt;code&gt;as u8&lt;/code&gt; casts — and one wrong shift silently corrupts your data. Every integer type already knows how to lay itself out, in the exact endianness you ask for.&lt;/p&gt;</description></item></channel></rss>