Skip to content

Instantly share code, notes, and snippets.

@rsperl
Last active July 25, 2022 16:09
Show Gist options
  • Save rsperl/7a0bc0d9c3b083c8a33e02f2619254f8 to your computer and use it in GitHub Desktop.
Save rsperl/7a0bc0d9c3b083c8a33e02f2619254f8 to your computer and use it in GitHub Desktop.
convert a binary guid from ldap or active directory to a hex string #python #ldap #snippet
#!/usr/bin/python3
import uuid
def guid_to_string(binary_guid: bytes) -> str:
return str(uuid.UUID(bytes_le=binary_guid)).lower()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment