<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[How the software is made]]></title><description><![CDATA[Design & software]]></description><link>https://pyrolistical.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!XMB9!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fpyrolistical.substack.com%2Fimg%2Fsubstack.png</url><title>How the software is made</title><link>https://pyrolistical.substack.com</link></image><generator>Substack</generator><lastBuildDate>Mon, 06 Apr 2026 15:24:33 GMT</lastBuildDate><atom:link href="https://pyrolistical.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Ronald Chen]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[pyrolistical@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[pyrolistical@substack.com]]></itunes:email><itunes:name><![CDATA[Ronald Chen]]></itunes:name></itunes:owner><itunes:author><![CDATA[Ronald Chen]]></itunes:author><googleplay:owner><![CDATA[pyrolistical@substack.com]]></googleplay:owner><googleplay:email><![CDATA[pyrolistical@substack.com]]></googleplay:email><googleplay:author><![CDATA[Ronald Chen]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Typed UUIDs for free]]></title><description><![CDATA[I like Stripe IDs.]]></description><link>https://pyrolistical.substack.com/p/typed-uuids-for-free</link><guid isPermaLink="false">https://pyrolistical.substack.com/p/typed-uuids-for-free</guid><dc:creator><![CDATA[Ronald Chen]]></dc:creator><pubDate>Fri, 15 Sep 2023 21:15:05 GMT</pubDate><content:encoded><![CDATA[<p>I like Stripe IDs. They are an encoding of <a href="https://en.wikipedia.org/wiki/Strongly_typed_identifier">strongly typed identifiers</a>, IDs with a type prefix. For example, a customer ID <code>cus_yV58jmuUEUGDDVThFIxuaw</code> won&#8217;t be confused with a payment ID <code>py_b518dLn270WLyIIe7zLMPw</code>. And I am not alone. Others have implemented this as an <a href="https://github.com/jetpack-io/typeid">open source library</a>.</p><p>The examples shown are 128 bit UUIDs encoded as 22 characters in base64. But since each base64 character encodes 6 bits, we have actually encoded a total of 22*6=132 bits. 132-128=4 bits are wasted.</p><p>But what if we could use those 4 extra bits? 4 bits is 2^4=16 elements. If we have a fixed number of types less than 16, we could encode the type as 4 bits and prefix it to the UUID. This would result in 22 characters in base64.</p><p>While we would lose the ability to look IDs at a glance to see their type, APIs can still produce an useful error message when unexpected typed ID is provided.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://pyrolistical.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading How the software is made! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>