Last active
January 30, 2024 14:12
-
-
Save oscyp/5a11572fcdefb23084d99e5d9e9c511a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var id = ConvertGuidToBinData3("xxxxxxxxxxxxxx"); | |
Console.WriteLine("{ \"Customer._id\": BinData(3, '" + id + "') }"); | |
} | |
public static Guid ConvertBinData3ToGuid(string input) | |
{ | |
var bytes = Convert.FromBase64String(input); | |
return new Guid(bytes); | |
} | |
public static string ConvertGuidToBinData3(string input) { | |
Guid parsed = Guid.Parse(input); | |
return Convert.ToBase64String(parsed.ToByteArray()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment