ObjectID Converter

This project is a TypeScript native implementation of the Microsoft's cloud Object ID to Security Identifier (SID) process.
This project is not compatible with Windows Server Active Directory (AD DS) Object ID to SID, or SID to Object ID conversions.
Inspiration for this project:
https://oliverkieselbach.com/2020/05/13/powershell-helpers-to-convert-azure-ad-object-ids-and-sids/
Convert Object ID to SID
To convert your Object ID to a SID, use the convertToSid() function. It has only one parameter, the ObjectID, it takes a UUIDv4 format string then converts it to an Entra ID (Azure AD) compatible SID.
import { convertToSid } from '@software-hardware-integration-lab/objectid-converter';
const objectId = 'f82d79af-1278-4894-ac01-d90e30875cf8';
const results = convertToSid(objectId);
console.log(results);
SID Result
S-1-12-1-4163729839-1217663608-249102764-4166813488
Convert SID to Object ID
To convert your SID to an Object ID, use the convertToObjectId() function. It has only one parameter, the SID, it takes an Entra ID (Azure AD) compatible SID string then converts it to an Object ID (UUIDv4).
import { convertToObjectId } from '@shi-corp/objectid-converter';
const securityId = 'S-1-12-1-4163729839-1217663608-249102764-4166813488';
const results = convertToObjectId(securityId);
console.log(results);
Object ID Result
f82d79af-1278-4894-ac01-d90e30875cf8