转换的GUID整数和返回整数、GUID

由网友(酷味有余)分享简介:所以我有一个第三方的应用程序,我有一个接口,这个应用程序需要从我的用户表中的用户ID。问题是,我存储我的用户ID作为GUID的和第三方的应用程序只接受一个整数。所以我想,如果有一种方法来一个GUID转换为整数,然后可以将其转换回(我得到有关用户ID从他们的服务器通信),那么我不必再codeA太多。任何想法?so I...

所以我有一个第三方的应用程序,我有一个接口,这个应用程序需要从我的用户表中的用户ID。问题是,我存储我的用户ID作为GUID的和第三方的应用程序只接受一个整数。所以我想,如果有一种方法来一个GUID转换为整数,然后可以将其转换回(我得到有关用户ID从他们的服务器通信),那么我不必再codeA太多。任何想法?

so I have a 3rd party application that I have to interface with, this application needs the userID from my users table. the problem is that I store my userIDs as GUIDs and the 3rd party app only accepts an integer. so I figure, if there is a way to convert a GUID to an integer then be able to convert it back (as i get communications from their server regarding the userID) then I don't have to recode a too much. any ideas?

推荐答案

您将需要一个存储从您的GUID的映射到第三方的整数:无论是新的INT thirdPartyId字段中现有的用户表,或者新表。

You'll need a store a mapping from your Guid to the 3rd party's integer: either a new "int thirdPartyId" field in your existing user table, or a new table.

阅读全文

相关推荐

最新文章