guid

UUID format: 8-4-4-4-12 - Why?

╄→гoц情女王★ 提交于 2019-11-28 05:10:27
Why are UUID's presented in the format "8-4-4-4-12" (digits)? I've had a look around for the reason but can't find the decision that calls for it. Example of UUID formatted as hex string: 58D5E212-165B-4CA0-909B-C86B9CEE0111 It's separated by time, version, clock_seq_hi, clock_seq_lo, node , as indicated in the followoing rfc. From the IETF RFC4122: 4.1.2. Layout and Byte Order To minimize confusion about bit assignments within octets, the UUID record definition is defined only in terms of fields that are integral numbers of octets. The fields are presented with the most significant one first.

Is Microsoft's GUID generator cryptographically secure

六月ゝ 毕业季﹏ 提交于 2019-11-28 04:06:08
问题 I have searched multiple resources online, but so far have been unable to find a definitive answer to the question of whether Microsoft's GUID generation mechanism is secure enough to warrant it's use as a unique ID across an application. To clarify, by 'secure enough', I mean to ask whether the algorithm used to generate the GUID has any known weaknesses or vulnerability that could reduce the effective randomness of the GUID i.e. result in a non-negligible number of collisions . If no, does

Generate GUID in MySQL for existing Data?

自作多情 提交于 2019-11-28 03:38:00
I've just imported a bunch of data to a MySQL table and I have a column "GUID" that I want to basically fill down all existing rows with new and unique random GUID's. How do I do this in MySQL ? I tried UPDATE db.tablename SET columnID = UUID() where columnID is not null And just get every field the same I'm not sure if it's the easiest way, but it works. The idea is to create a trigger that does all work for you, then, to execute a query that updates your table, and finally to drop this trigger: delimiter // create trigger beforeYourTableUpdate BEFORE UPDATE on YourTable FOR EACH ROW BEGIN

Convert UUID 32-character hex string into a “YouTube-style” short id and back

元气小坏坏 提交于 2019-11-28 03:20:51
I'm assigning all my MongoDB documents a GUID using uuid.uuid1(). I want a way I can derive an 11 character, unique, case-sensitive YouTube-like ID, such as 1_XmY09uRJ4 from uuid's resulting hex string which looks like ae0a0c98-f1e5-11e1-9t2b-1231381dac60 I want to be able to match the shortened ID to the hex and vice-versa, dynamically without having to store another string in the database. Does anyone have some sample code or can point me in the direction of the module or formula that can do this? Convert the underlying bytes to a base64 value, stripping the = padding and the newline. You

Simple Generation of GUID in C

…衆ロ難τιáo~ 提交于 2019-11-28 03:00:47
问题 I feel like GUID/UUID questions have been done to death here, but I can't seem to find quite what I'm looking for. I need a function that will generate V4 GUIDs in C, i.e. something that is essentially compatibile with Guid.NewGuid from C#. This has to work on Windows (XP, Server 2003/8, etc) and 3 different distros of Unix (AIX, Sun, and HP). I've seen some of the specification white papers, some that even have some sample implementations, but there always seems to be an issue with proper

Javascript convert GUID in string format into Base64

帅比萌擦擦* 提交于 2019-11-28 00:56:43
问题 I'm in a client-side, javascript context. I have a GUID in string format e8b75aff-3422-4529-8a6a-15b33e674f48 and I need it in a Base64 string /1q36CI0KUWKahWzPmdPSA== How do I convert it? Thanks. 回答1: // Convert GUID string to Base-64 in Javascript // by Mark Seecof, 2012-03-31 var hexlist = '0123456789abcdef'; var b64list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // GUID string with four dashes is always MSB first, // but base-64 GUID's vary by target-system

How do you initialise a const array of TGUID from Interface type data, in Delphi?

核能气质少年 提交于 2019-11-28 00:31:51
问题 I want to initialise an array like this - Const MyArray : Array[0..0] Of TGUID = (IInterface); But it results in - [DCC Error] Test.pas(10): E2010 Incompatible types: 'TGUID' and 'string' So to see what would happen I tried this - Const MyArray : Array[0..0] Of String = (IInterface); Which results in this! [DCC Error] Test.pas(10): E2010 Incompatible types: 'string' and 'TGUID' How strange! Surely IInterface is one or the other, but it seems to stubbornly transform into the wrong type. 回答1:

Converting System.Decimal to System.Guid

好久不见. 提交于 2019-11-27 23:47:59
I have a big dictionary where the key is decimal, but the GetHashCode() of System.Decimal is disasterously bad. To prove my guess, I ran a for loop with 100.000 neigboring decimals and checked the distribution. 100.000 different decimal numbers used only 2 (two!!!) different hashcodes. Decimal is represented as 16 bytes. Just like Guid! But the GetHashCode() distribution of Guid is pretty good. How can I convert a decimal to Guid in C# as cheap as possible? Unsafe code is OK! EDIT: The test was requested, so here is the code: decimal d = 96000000000000000000m; Dictionary<int, int> hashcount =

Alternative to __uuidof in C

梦想与她 提交于 2019-11-27 23:42:20
问题 I'm working with a C project that's using DirectX and I've run into a problem. Certain DX calls require a IID object, typically generated with __uuidof . One thing this is required for is creating a RenderTargetView. The DirectX samples/tutorials do this: ID3D11Texture2D* pBackBuffer = NULL; hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), ( LPVOID* )&pBackBuffer ); When I try to call __uuidof in my C code, I get an compiler error: Error 19 error C4233: nonstandard extension used

Are automatically generated GUIDs for types in .NET consistent?

五迷三道 提交于 2019-11-27 21:58:59
Are the automatically generated GUIDs for C# Types consistent? For example, if I get a GUID for my interface, IFoo ( typeof(IFoo).GUID ), the first time a run the program, will I get that same GUID everytime I run the program? I have tested it locally on my machine, and it seems to always be the same, but I'm not sure if I can rely on it always being the same across machines. See: System.Type.GUID stability . It appears that the current implementation of the method relies an internal call that is implemented by the CLR itself. Unless Microsoft clarifies the contracts for the auto-generated