.NET Short Unique Identifier

前端 未结 23 1176
忘掉有多难
忘掉有多难 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

    you can use

    code = await UserManager.GenerateChangePhoneNumberTokenAsync(input.UserId, input.MobileNumber);
    

    its 6 nice characters only, 599527 ,143354

    and when user virify it simply

    var result = await UserManager.VerifyChangePhoneNumberTokenAsync(input.UserId, input.Token, input.MobileNumber);
    

    hope this help you

提交回复
热议问题