.NET Short Unique Identifier

前端 未结 23 1168
忘掉有多难
忘掉有多难 2020-12-07 11:27

I need a unique identifier in .NET (cannot use GUID as it is too long for this case).

Do people think that the algorithm used here is a good candidate or do you have

23条回答
  •  时光说笑
    2020-12-07 12:22

    Just in case merely removing hyphens will do for anyone:

    Guid.NewGuid().ToString("n")
    

    This generates perfectly unique strings of 32 characters:

    5db4cee3bfd8436395d37fca2d48d5b3
    82fac271c76148a3a0667c00a5da990d
    

提交回复
热议问题