转换的GUID整数和返回 [英] Converting GUID to Integer and Back

查看:109
本文介绍了转换的GUID整数和返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个第三方的应用程序,我有一个接口,这个应用程序需要从我的用户表中的用户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.

这篇关于转换的GUID整数和返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆