<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>《告别 google/uuid：Go 标准库拟新增 crypto/uuid 深度解析》的评论</title>
	<atom:link href="http://tonybai.com/2026/03/01/goodbye-google-uuid-go-standard-library-crypto-uuid/feed/" rel="self" type="application/rss+xml" />
	<link>https://tonybai.com/2026/03/01/goodbye-google-uuid-go-standard-library-crypto-uuid/</link>
	<description>一个程序员的心路历程</description>
	<lastBuildDate>Wed, 25 Mar 2026 09:21:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2026/03/01/goodbye-google-uuid-go-standard-library-crypto-uuid/#comment-7884</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Sun, 01 Mar 2026 11:37:49 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=5965#comment-7884</guid>
		<description>赞</description>
		<content:encoded><![CDATA[<p>赞</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：it512</title>
		<link>https://tonybai.com/2026/03/01/goodbye-google-uuid-go-standard-library-crypto-uuid/#comment-7882</link>
		<dc:creator>it512</dc:creator>
		<pubDate>Sun, 01 Mar 2026 07:56:33 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=5965#comment-7882</guid>
		<description>至于使用struct 隐藏底层的实现，这方面的考虑为，uuid其实是一个int128，或者说用int128作为uuid的实现更好，例如 python， rust语言由于支持int128 其uuid的实现均为int128，很遗憾的是golang目前不支持int128， 但不代表以后不支持，所有这里我也提议采用struct 隐藏底层实现，其实是为未来做准备。

另外提议struct另外一个考虑，也源自为postgresql 中uuid的实现（ 这里请允许我自我吹嘘一下，我也是pguuid的最初的作者）pguuid uuid 的定义就是一个struct，2个int16， 一个int32， 基于这个基础，对正数操作其实比操作单个字节更高效，比较大小起来也很简单。 另外，也可以用smid 指令加速

但是很遗憾，neild 没有采纳， 主要还是考虑和google/uuid的兼容性</description>
		<content:encoded><![CDATA[<p>至于使用struct 隐藏底层的实现，这方面的考虑为，uuid其实是一个int128，或者说用int128作为uuid的实现更好，例如 python， rust语言由于支持int128 其uuid的实现均为int128，很遗憾的是golang目前不支持int128， 但不代表以后不支持，所有这里我也提议采用struct 隐藏底层实现，其实是为未来做准备。</p>
<p>另外提议struct另外一个考虑，也源自为postgresql 中uuid的实现（ 这里请允许我自我吹嘘一下，我也是pguuid的最初的作者）pguuid uuid 的定义就是一个struct，2个int16， 一个int32， 基于这个基础，对正数操作其实比操作单个字节更高效，比较大小起来也很简单。 另外，也可以用smid 指令加速</p>
<p>但是很遗憾，neild 没有采纳， 主要还是考虑和google/uuid的兼容性</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：it512</title>
		<link>https://tonybai.com/2026/03/01/goodbye-google-uuid-go-standard-library-crypto-uuid/#comment-7881</link>
		<dc:creator>it512</dc:creator>
		<pubDate>Sun, 01 Mar 2026 07:39:26 +0000</pubDate>
		<guid isPermaLink="false">https://tonybai.com/?p=5965#comment-7881</guid>
		<description>我是 it512， 也是 google/uuid v7 的捐献者，我也参与了这个issus的讨论，很高兴在这里也能看到您对uuid的关注。

其实对于v7 取消返回error 作为原始v7的作者我是持保留态度的， 理由：
v7的精度只有ms ，那么1ms中产生的uuid是有限的，大约4000个不到，如果超出这个限度怎么办？ google/uuid中我实现的版本是返回一个未来的时间， 这个是否是最优呢？
我在实现v7时，也考虑过接返回一个error。这也是我保留取消error的原因。

另一个就是对V8 的支持，自定义uuid是有需求的， 当然，你可以创建一个v8 uuid的string 然后parser回去， 可以直接填充UUID数组，我认为应该提供一些辅助函数用于解决这些问题</description>
		<content:encoded><![CDATA[<p>我是 it512， 也是 google/uuid v7 的捐献者，我也参与了这个issus的讨论，很高兴在这里也能看到您对uuid的关注。</p>
<p>其实对于v7 取消返回error 作为原始v7的作者我是持保留态度的， 理由：<br />
v7的精度只有ms ，那么1ms中产生的uuid是有限的，大约4000个不到，如果超出这个限度怎么办？ google/uuid中我实现的版本是返回一个未来的时间， 这个是否是最优呢？<br />
我在实现v7时，也考虑过接返回一个error。这也是我保留取消error的原因。</p>
<p>另一个就是对V8 的支持，自定义uuid是有需求的， 当然，你可以创建一个v8 uuid的string 然后parser回去， 可以直接填充UUID数组，我认为应该提供一些辅助函数用于解决这些问题</p>
]]></content:encoded>
	</item>
</channel>
</rss>
