Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert AD's objectGUID to string

Hi!
I need to convert an Active Directory's objectGUID (which is binary data) to a string (like "9698dc61-89f0-42b9-90c8-b54aee97d4ff").
How can I do it?
Labels (2)
3 Replies
Anonymous
Not applicable
Author

Create a routine and add this method to it:
	
public static String toHexString(byte[] bin) {
StringBuilder sb = new StringBuilder();
for (byte b : bin) {
sb.append(Integer.toHexString(b));
}
return sb.toString();
}
Anonymous
Not applicable
Author

Thanks, jlolling!
The solution produce output like "61ffffffdcffffff98ffffff96fffffff0ffffff89ffffffb942ffffff90ffffffc8ffffffb54affffffeeffffff97ffffffd4ffffffff" (instead of 9698dc61-89f0-42b9-90c8-b54aee97d4ff), but you have pointed me to right way, so I'll try to use existing java examples to generate required string.
If anybody have the complete solution for generation GUID in AD style, post it here, please.
Anonymous
Not applicable
Author

Yes, the values you get are 4-byte digits. My code was made for 1-byte digits.