question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

How to generate a ServerId GUID for testing purposes?

Context: I'm trying to test some systems which will depend on ServerIds from server v2.0. I'd like to generate some 'fake' ServerIds so I can test it locally first.

How do I generate GUIDs that look like this?

0595d58b096937ab3b3480f520a3468e39099daa7e646e294e79eab497c42a38

(64 length)

Currently my approach looks something like:

string fakeGuid = Guid.NewGuid().ToString();

which outputs:

51d783be-d5b0-43b6-873c-9f1b778cad00

which is not nearly long enough to match the ServerId format

Custom Game Servers
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

ServerId like 0595d58b096937ab3b3480f520a3468e39099daa7e646e294e79eab497c42a38 is not a GUID, it’s a random string. You can write a random string generator function by yourself to generate a string like it.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.