guid

How to Combine Two GUID Values

岁酱吖の 提交于 2019-12-06 11:30:29
问题 I want to combine two guid values and generate a 32 bit alphanumberic value(It can be done by using hashing). 回答1: Not Pretty, but it works.. private static Guid MungeTwoGuids(Guid guid1, Guid guid2) { const int BYTECOUNT = 16; byte[] destByte = new byte[BYTECOUNT]; byte[] guid1Byte = guid1.ToByteArray(); byte[] guid2Byte = guid2.ToByteArray(); for (int i = 0; i < BYTECOUNT; i++) { destByte[i] = (byte) (guid1Byte[i] ^ guid2Byte[i]); } return new Guid(destByte); } and yes, I can deal with the

Use of GUIDs as id in public facing data integration web service

岁酱吖の 提交于 2019-12-06 10:18:33
To put the question into some context, the system exposing the web service uses GUIDs internally as identifiers for all entities. In such case, when designing a public facing data integration web service (used mainly for importing or exporting data from the system to other, external systems), what would you consider as pros and cons of using the internal identifiers in the interface of the service? With such solution, the export methods of the web service would return the dto's identified with GUIDs and the import methods would accept similar dto's - I assume the external system would be

base64 to guid to base64

天涯浪子 提交于 2019-12-06 05:52:40
问题 I'm currently researching MongoDb as a possible database option, and I'm having trouble dealing with Guid serialization. I thought at first maybe this was a bug in the C# driver's serialization, but now I think it's more likely a naive assumption on my part. To help me convert the Bson base64 representations back and forth to Guids, I wrote a couple of little powershell functions to help: function base64toguid { param($str); $b = [System.Convert]::FromBase64String($str); $hex = ""; foreach (

Should I use Oracle's sys_guid() to generate guids?

做~自己de王妃 提交于 2019-12-06 05:13:32
问题 I have some inherited code that calls SELECT SYS_GUID() FROM DUAL each time an entity is created. This means that for each insertion there are two calls to Oracle, one to get the Guid , and another to insert the data. I suppose that there may be a good reason for this, for example - Oracle's Guids may be optimized for high-volume insertions by being sequential and thus they maybe are trying to avoid excessive index tree re-balancing. Is there a reason to use SYS_GUID as opposed to building

SQL Server database with clustered GUID PKs - switch clustered index or switch to sequential (comb) GUIDs?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 02:34:59
问题 We have a database in which all the PKs are GUIDs, and most of the PKs are also the clustered index for the table. We know that this is bad (due to the random nature of GUIDs). So, it seems there are basically two options here (short of throwing out GUIDs as PKs altogether, which we cannot do (at least not at this time)). We could change the GUID generation algorithm to e.g. the one that NHibernate uses, as detailed in this post, or we could, for the tables that are under the heaviest use,

Manual change of GUID - how bad is it?

放肆的年华 提交于 2019-12-06 02:16:11
How bad is changing generated GUID manually and using it? Is the probability of collision still insignificant or is manipulation with GUIDs dangerous? Sometimes we just change some letter of previously generated GUID and use it. Should we stop doing it? This depends on the version of the GUID and where you are making the change. Let's dissect a little how a GUID actually looks like: A GUID has a version.   The 13th hex digit in a GUID marks its version. Current GUIDs are usually generated with version 4. If you change the version backwards you risk collision with a GUID that already exists.

Why are public fields and properties interchangeably binary compatible?

戏子无情 提交于 2019-12-06 02:12:24
问题 In the day job, I work on a VB6 (I know, but don't mock the afflicted...) application that uses a number of libraries we have written (also in the ever illustrious VB6). One of these supporting libraries had a load of private members exposed via public properties, and I was asked to remove the properties, and promote the private member variables into public fields with the same name as the original properties. Now, I'm no COM expert, but I was under the impression that each and every exposed

Securing AJAX Requests via GUID

南楼画角 提交于 2019-12-06 01:37:13
问题 I'm writing a web app that will be making requests via AJAX and would like to lock down those calls. After a little research, I am considering using some form of random token (string) to be passed back along with the request (GUID?). Here's the important parts of my algorithm: Assign a token to a JavaScript variable (generated server-side). Also, store that token in a DB and give it a valid time period (i.e. 10 minutes). If the token has still not been used and is within it's valid time

C# vs2017创建Com组件,并注册

北慕城南 提交于 2019-12-05 22:13:58
1.创建一个普通类库dll项目,如:MyCom. 2.导出接口,添加Guid,Guid为全局唯一标识,可以用VS2017自带工具获取.获取Guid的方法,如图: (1)打开自带Guid工具. (2)首先选择Guid格式,一般选择格式为5,然后点击“新建GUID”,再点击复制,即可获取Guid [DispId(1)]为函数的标识。如果有多个函数可相应的在函数前面加[DispId(2)], [DispId(3)]… 来源: https://www.cnblogs.com/Wonderful-Life/p/10490070.html

Unique Identifier for NSManagedObject

∥☆過路亽.° 提交于 2019-12-05 18:15:46
问题 I have a need to obtain a unique identifier for a type of NSManagedObject I've created. It needs to be available as soon as the object has been created, never change, and be completely unique. This rules out the NSManagedObjectID , as this can change when the context is saved. I believe the -hash method could be non-unique if my objects have the same properties. I'd really like to avoid creating an otherwise useless uniqueIdentifier UUID field on the entity as this seems wasteful and messy.