GUID有多短? [英] How short can a GUID be?

查看:80
本文介绍了GUID有多短?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道标准的GUID.可以将它们缩短吗?背后的理论是什么?

I know the standard GUIDs. Can they be made shorter? What is the theory behind it?

推荐答案

Greg Dean的答案是正确的,但是为了理解GUID的生成方式以及为什么不应该缩短它,我强烈建议您阅读以下文章.

Greg Dean's answer is correct but in order to understand how a GUID is generated and why it ought not to be shortened I would highly suggest you read the article below.

旧的新事物:GUID在全球范围内是唯一的,但GUID的子字符串不是 :

需要生成一个客户的客户 8字节的唯一值及其初始值 想法是生成一个GUID并抛出 离开下半场,保持 前八个字节.他们想知道 如果这是个好主意.

A customer needed to generate an 8-byte unique value, and their initial idea was to generate a GUID and throw away the second half, keeping the first eight bytes. They wanted to know if this was a good idea.

不,这不是一个好主意.

No, it's not a good idea.

GUID生成算法依赖 它具有全部16个字节的事实 用于建立唯一性,以及 你丢掉一半,你输了 唯一性.

The GUID generation algorithm relies on the fact that it has all 16 bytes to use to establish uniqueness, and if you throw away half of it, you lose the uniqueness.

这篇关于GUID有多短?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆