How can I generate GUIDs in Excel?

The following Excel expression evaluates to a V4 GUID: =CONCATENATE(DEC2HEX(RANDBETWEEN(0,4294967295),8),”-“,DEC2HEX(RANDBETWEEN(0,65535),4),”-“,DEC2HEX(RANDBETWEEN(16384,20479),4),”-“,DEC2HEX(RANDBETWEEN(32768,49151),4),”-“,DEC2HEX(RANDBETWEEN(0,65535),4),DEC2HEX(RANDBETWEEN(0,4294967295),8)) -or (depending on locale setting/decimal and list separators)- =CONCATENATE(DEC2HEX(RANDBETWEEN(0;4294967295);8);”-“;DEC2HEX(RANDBETWEEN(0;65535);4);”-“;DEC2HEX(RANDBETWEEN(16384;20479);4);”-“;DEC2HEX(RANDBETWEEN(32768;49151);4);”-“;DEC2HEX(RANDBETWEEN(0;65535);4);DEC2HEX(RANDBETWEEN(0;4294967295);8)) Note that the first character of the third group is always 4 to signify a V4 (pseudo-random number generated) GUID/UUID per RFC 4122 section 4.4. Also note that the first character of the fourth group is … Read more

How are .NET 4 GUIDs generated?

Since Windows 2000 Microsoft uses a version 4 algorithm: With Windows 2000, Microsoft switched to version 4 GUIDs, since embedding the MAC address was viewed as a security risk. 1 You can see that as well from a GUID generated in .NET (from Wikipedia): Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with any hexadecimal digits … Read more

What is the string length of a GUID?

It depends on how you format the Guid: Guid.NewGuid().ToString() = 36 characters (Hyphenated) outputs: 12345678-1234-1234-1234-123456789abc Guid.NewGuid().ToString(“D”) = 36 characters (Hyphenated, same as ToString()) outputs: 12345678-1234-1234-1234-123456789abc Guid.NewGuid().ToString(“N”) = 32 characters (Digits only) outputs: 12345678123412341234123456789abc Guid.NewGuid().ToString(“B”) = 38 characters (Braces) outputs: {12345678-1234-1234-1234-123456789abc} Guid.NewGuid().ToString(“P”) = 38 characters (Parentheses) outputs: (12345678-1234-1234-1234-123456789abc) Guid.NewGuid().ToString(“X”) = 68 characters (Hexadecimal) outputs: {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x9a,0xbc}}

A TypeScript GUID class? [closed]

Updated Answer This is now something you can do natively in JavaScript/TypeScript with crypto.randomUUID(). Here’s an example generating 20 UUIDs. for (let i = 0; i < 20; i++) { let id = crypto.randomUUID(); console.log(id); } Original Answer There is an implementation in my TypeScript utilities based on JavaScript GUID generators. Here is the code: … Read more

How to generate a new GUID?

You can try the following: function GUID() { if (function_exists(‘com_create_guid’) === true) { return trim(com_create_guid(), ‘{}’); } return sprintf(‘%04X%04X-%04X-%04X-%04X-%04X%04X%04X’, mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)); } Source – com_create_guid

How securely unguessable are GUIDs?

UUIDs/GUIDs are specified by RFC4122. Although Version 4 UUIDs are created from random numbers Section 6 makes an explicit statement on security: Do not assume that UUIDs are hard to guess; they should not be used as security capabilities (identifiers whose mere possession grants access), for example. A predictable random number source will exacerbate the … Read more