问题标签 [uuid]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
3894 浏览

java - Java UUID 字符串表示自然排序

假设我有两个 UUID 实例:

如果这两个比较uuid1小于uuid2即,

他们的字符串表示是否总是会比较以给出相同的结果,即

0 投票
10 回答
73183 浏览

mysql - MySQL中的UUID性能?

我们正在考虑使用 UUID 值作为 MySQL 数据库的主键。插入的数据是从数十、数百甚至数千台远程计算机生成的,并且以每秒 100-40,000 次插入的速度插入,我们永远不会进行任何更新。

在我们开始剔除数据之前,数据库本身通常会达到大约 50M 条记录,因此不是一个庞大的数据库,但也不是很小的。我们还计划在 InnoDB 上运行,但如果有更好的引擎来支持我们正在做的事情,我们愿意改变这一点。

我们已经准备好使用 Java 的 Type 4 UUID,但在测试中看到了一些奇怪的行为。一方面,我们存储为 varchar(36),我现在意识到使用 binary(16) 会更好——尽管我不确定会更好。

更大的问题是:当我们有 50M 条记录时,这些随机数据对索引的影响有多大?例如,如果我们使用最左边的位带有时间戳的类型 1 UUID,我们会更好吗?或者也许我们应该完全放弃 UUID 并考虑 auto_increment 主键?

我正在寻找关于不同类型 UUID 在 MySQL 中作为索引/主键存储时的性能的一般想法/提示。谢谢!

0 投票
1 回答
1198 浏览

java-me - java代码中的错误(j2me)

我收到以下代码的异常。我无法理解什么是 UUID。任何人都可以帮助解决此错误吗?我已经发布了代码以及我得到的错误。

错误是:

0 投票
4 回答
5410 浏览

php - 如何在 php 上创建一个唯一的 20 个单字节令牌/密钥/ID?

我需要创建一个令牌/密钥以将其用作数字顺序,因此这应该是唯一的,令牌必须类似于“6X990742MG185953R”,因此我们可以像条形码一样使用它,例如。http://barcodes4.me/barcode/c128b/6X990742MG185953R.png

我们不能使用 UUID 或 GUID,因为太长了,我们越接近是这样的:

0 投票
4 回答
2271 浏览

mysql - Web PK,自动增量与 UUID 样式,哪个更好,为什么?

自动增量和 UUID 样式之间的真正区别是什么?

我认为 auto inc 与 uuid 相比很容易破解

在有很多记录的查询中,Uuid 比自动增量慢,但它有很大的不同吗?

0 投票
1 回答
3119 浏览

cassandra - 如何在 Cassandra 中插入带有 TimeUUIDType 列的行?

在 Cassandra 中,我有以下列族:

我正在尝试使用 Thrift 生成的 C++ 生成函数将记录插入其中,如下所示:

但是,我收到以下错误:“UUID 必须正好是 16 个字节”

我什至使用以下命令尝试了 Cassandra CLI:

但我仍然收到以下错误:

0 投票
1 回答
478 浏览

c# - 在 C# 中读取 Java UUID(来自 DB)

我正在尝试将其中一列是二进制数组(它是 Java UUID)的表映射到 C# 类。

我想读取字节数组并返回 UUID 的字符串表示形式。只是想知道什么是开始的好地方。

0 投票
6 回答
19150 浏览

python - Python - Why use anything other than uuid4() for unique strings?

I see quit a few implementations of unique string generation for things like uploaded image names, session IDs, et al, and many of them employ the usage of hashes like SHA1, or others.

I'm not questioning the legitimacy of using custom methods like this, but rather just the reason. If I want a unique string, I just say this:

And I'm done with it. I wasn't very trusting before I read up on uuid, so I did this:

Not one repeater (I wouldn't expect one now considering the odds are like 1.108e+50, but it's comforting to see it in action). You could even half the odds by just making your string by combining 2 uuid4()s.

So, with that said, why do people spend time on random() and other stuff for unique strings, etc? Is there an important security issue or other regarding uuid?

0 投票
1 回答
1749 浏览

c++ - 如何在编译时从字符串生成 boost uuid

有没有办法在编译时从像 988A00C4-79F3-46f9-98CD-D5AD4AA2A0FE 这样的字符串生成 boost uuid?

0 投票
2 回答
7078 浏览

php - php中规范uuid表示的16字节二进制形式

如何从字符串/规范表示中获取 uuid 的 16 字节二进制形式:

前任:1968ec4a-2a73-11df-9aca-00012e27a270

干杯,/马辛