Skip to content

Instantly share code, notes, and snippets.

@islaytitans
Created April 30, 2017 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save islaytitans/2d944ed11f06325ccf22409ef91bc36f to your computer and use it in GitHub Desktop.
Save islaytitans/2d944ed11f06325ccf22409ef91bc36f to your computer and use it in GitHub Desktop.
Encode Sitecore Contact Ids
// Id of the Contact in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
string contactId = "50638e2f-43b2-46ee-806d-665f4fb08954";
var guid = Guid.Parse(contactId);
var bytes = guid.ToByteArray();
string encodedId = Convert.ToBase64String(bytes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment