How to generate a GUID in VBScript?

Function CreateGUID Dim TypeLib Set TypeLib = CreateObject(“Scriptlet.TypeLib”) CreateGUID = Mid(TypeLib.Guid, 2, 36) End Function This function will return a plain GUID, e.g., 47BC69BD-06A5-4617-B730-B644DBCD40A9. If you want a GUID in a registry format, e.g., {47BC69BD-06A5-4617-B730-B644DBCD40A9}, change the function’s last line to CreateGUID = Left(TypeLib.Guid, 38)

Storing MySQL GUID/UUIDs

From MySQL 8.0 and above you could use UUID_TO_BIN: UUID_TO_BIN(string_uuid), UUID_TO_BIN(string_uuid, swap_flag) Converts a string UUID to a binary UUID and returns the result. (The IS_UUID() function description lists the permitted string UUID formats.) The return binary UUID is a VARBINARY(16) value. CREATE TABLE t (id binary(16) PRIMARY KEY); INSERT INTO t VALUES(UUID_TO_BIN(UUID(), true)); INSERT … Read more

Convert .NET Guid to MongoDB ObjectID

You can’t convert ObjectId into GUID and vice versa, because they are two different things(different sizes, algoritms). You can use any type for mongoDb _id including GUID. For example in official c# driver you should specify attribute [BsonId]: [BsonId] public Guid Id {get;set;} [BsonId] public int Id {get;set;} ObjectId: A BSON ObjectID is a 12-byte … Read more

How to create guid in PostgreSQL

PostgreSQL has the uuid-ossp extension which ships with the standard distributions and it has 5 standard algorithms for generating uuids. Note that a guid is the Microsoft version of a uuid, conceptually they are the same thing. CREATE EXTENSION “uuid-ossp”; Then: SELECT uuid_generate_v4(); Note also that, once you installed the extension, PostgreSQL has an actual … Read more

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

Convert the underlying bytes to a base64 value, stripping the = padding and the newline. You probably want to use the base64.urlsafe_b64encode() function to avoid using / and + (_ and – are used instead), so the resulting string can be used as a URL path element: >>> import uuid, base64 >>> base64.urlsafe_b64encode(uuid.uuid1().bytes).rstrip(b’=’).decode(‘ascii’) ’81CMD_bOEeGbPwAjMtYnhg’ The … Read more

Is it possible that GUIDs are generated with all the same characters in .NET? (e. g.: {11111111-1111-1111-1111-111111111111})

In short: For GUID generated according to the published standards and specifications it simply can’t happen. A GUID has a structure and some of the fields actually have a meaning. What’s more, .NET generates GUIDs of version 4, where it absolutely can’t happen. They are defined in a way that there won’t be such a … Read more

GUID / UUID type in typescript

You could create a wrapper around a string and pass that around: class GUID { private str: string; constructor(str?: string) { this.str = str || GUID.getNewGUIDString(); } toString() { return this.str; } private static getNewGUIDString() { // your favourite guid generation function could go here // ex: http://stackoverflow.com/a/8809472/188246 let d = new Date().getTime(); if (window.performance … Read more

Create a cryptographically secure random GUID in .NET

Yes you can, Guid allows you to create a Guid using a byte array, and RNGCryptoServiceProvider can generate a random byte array, so you can use the output to feed a new Guid: public Guid CreateCryptographicallySecureGuid() { using (var provider = new RNGCryptoServiceProvider()) { var bytes = new byte[16]; provider.GetBytes(bytes); return new Guid(bytes); } }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)