.netasp.net

Converting GUID to Integer and Back


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?


Solution

  • 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.