<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>cryptowizard</title>
        <link>https://paragraph.com/@cryptowizard</link>
        <description>undefined</description>
        <lastBuildDate>Thu, 23 Apr 2026 03:35:39 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Programmers use Bytes, Buffers & Streams...from JS to Solidity]]></title>
            <link>https://paragraph.com/@cryptowizard/programmers-use-bytes-buffers-and-streamsfrom-js-to-solidity</link>
            <guid>aGkr7Bx2MdNlvKN2GgGC</guid>
            <pubDate>Mon, 20 Oct 2025 11:20:23 GMT</pubDate>
            <description><![CDATA[Converting high-level values (strings, objects) into bytes makes them interoperable with networks, files, hardware, cryptography and binary protocols. It often improves performance and determinism. A byte is 8 bits. For example in JS, converting data to bytes means, producing Uint8Array, ArrayBuffer, or Node.js Buffer containing the raw 8-bit values that represent your data. In browsers you typically use TextEncoder, ArrayBuffer, Uint8Array, or DataView. In Node.js you use Buffer (plus TypedA...]]></description>
            <content:encoded><![CDATA[<p>Converting high-level values (strings, objects) into bytes makes them interoperable with networks, files, hardware, cryptography and binary protocols. It often improves performance and determinism.</p><p>A byte is 8 bits. For example in JS, converting data to bytes means, producing Uint8Array, ArrayBuffer, or Node.js Buffer containing the raw 8-bit values that represent your data.</p><p>In browsers you typically use TextEncoder, ArrayBuffer, Uint8Array, or DataView.</p><p>In Node.js you use Buffer (plus TypedArray/ArrayBuffer) when interacting with WebAPIs<br><br>ArrayBuffer is a raw fixed-length binary buffer.</p><p>Uint8Array/ other TypedArrays - typed view over an ArrayBuffer.</p><p>DataView - lets you read/write multi-byte values with control over endianness.</p><p>Buffer (Node) - an optimized subclass of Uint8Array with many helpers</p><p>Often, incase of large file uploads,  streaming bytes is preferred over multipart/form-data. This is because multipart/form-data is <em>memory blocking</em>. It constructs a multipart MIME message. That means, it adds headers, boundaries, CRLFs, etc. It may buffer the entire form (file(s)) in memory or on disk temporarily. Only once the body is ready (or partially chunked) it starts sending.<br><br>In streaming, file is read from disk in chunks(say 64 KB each). Each chunk is streamed over the network. So its non-blocking memory.<br><br>Why Solidity and smart contracts use the so much?.<br>Smart contracts live in an extremely low-level, gas-constrained, and deterministic environment. Every operation on the Ethereum Virtual Machine (EVM) works on a 32-byte words. So Solidity's higher-level types(uint256, string, address) are just abstractions built on top of bytes in memory/storage. Every function call or event emits a byte buffer.<br>EVM memory is linear - just a big byte array. Solidity doesn't have JSON or protobuf. Everything passed to or from contracts must be encoded as bytes per the <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.soliditylang.org/en/latest/abi-spec.html">ABI</a> spec. <br>How?. But that's for another tutorial :-)</p>]]></content:encoded>
            <author>cryptowizard@newsletter.paragraph.com (cryptowizard)</author>
            <category>solidity</category>
            <category>buffers</category>
            <category>js</category>
            <category>streams</category>
            <category>programming</category>
            <enclosure url="https://storage.googleapis.com/papyrus_images/e6ea2c6a4fd5c0593e1552e697e0c00c2382c86e68f679c1444be5ad17fb7661.jpg" length="0" type="image/jpg"/>
        </item>
    </channel>
</rss>