I found 使用 python 生成 GUID 例程 http://code.activestate.com/recipes/163604/.
运行代码给出以下结果。
GUID: 00000129e0e72d9b2aab3c1500ac001000e90001
Time: Sat, 17 Jul 2010 09:55:33 (millis: 0.787)
IP: 172.16.233.1
Counter: 715865109
该代码的注释有以下消息。
### GUIDs make wonderful database keys. They require no access to the
### database (to get the max index number), they are extremely unique, and they sort
### automatically by time. GUIDs prevent key clashes when merging
### two databases together, combining data, or generating keys in distributed
### systems.
问题
- 这可以与 SQLite 一起使用吗?据我所知,SQLite中的INTEGER类型是8字节,并且使用8字节,不可能以十进制存储值0x00000129e0e72d9b2aab3c1500ac001000e90001或101362835865894089778560972572099193929729。
- 有什么方法可以使用 SQLite 获得全局唯一 ID 吗?
除了占用 32 个字节而不是 16 个字节之外,在 SQLite 中将 GUID 存储为文本有什么问题?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)