Using Parts of GUID as ID

后端 未结 6 753
借酒劲吻你
借酒劲吻你 2021-01-18 21:40

I\'m developing an ASP .Net MVC application. One of my actions requires id as a parameter. For example:

public actionresult Detail(Guid id){
            


        
6条回答
  •  鱼传尺愫
    2021-01-18 22:21

    GUID is designed in such a way that it is intended to be unique, but any part of it is not. See this blog post for details. If you need to shorten the GUID take a good hash of it - like SHA-1 or (if you don't have security concerns) MD5.

提交回复
热议问题