Creating different GUID for same lowercase and upper case strings

。_饼干妹妹 提交于 2019-12-11 03:15:20

问题


When I try to create GUIDs like this

Guid guid1 = Guid.Parse("aaaaaaaa-bbbb-cccc-eeee-ffffffffffff");
Guid guid2 = Guid.Parse("AAAAAAAA-BBBB-CCCC-EEEE-FFFFFFFFFFFF");

Both are creating same GUID object. Is it possible to create unique GUIDs for lower case and upper case version of same string?

Any ideas are welcome.


回答1:


GUIDs are actually bytes parsed from hexadecimal.
That is not possible.

You should not use GUIDs to store arbitrary data.




回答2:


Your strings are hexadecimal representations of the same value because hexadecimal is not case sensitive.

Your request is like saying that you don't want 0.5 to equal 1 / 2. They are different representations of the same value.

Perhaps you need a different method of generating GUIDs.



来源:https://stackoverflow.com/questions/17048282/creating-different-guid-for-same-lowercase-and-upper-case-strings

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!