# ObjectId **Repository Path**: MuNet/ObjectId ## Basic Information - **Project Name**: ObjectId - **Description**: ObjectId 来自于mongodb,是一种可排序的全局唯一标识符(GUID)。 - **Primary Language**: C# - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2018-01-05 - **Last Updated**: 2021-02-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # nobjectid > objectid from mongodb is a sort of global unique identifier(guid) ## use https://www.nuget.org/packages/nobjectid ```C# using System; namespace Demo { class Program { static void Main(string[] args) { var id= ObjectId.GenerateNewId().ToString(); Console.WriteLine(id); //5a4c769ea719be0daca68075 } } } ``` *the generated identifier consists of 24 characters, 12 bytes, according to the rules is divided into 4 parts: [the timestamp (4 bytes) | machine id (3 bytes) | process id (2 bytes) | increment number (3 bytes)]* > documentation please see: http://www.mongodb.org/display/DOCS/Object+IDs