Class DotNetGuid1Codec
- java.lang.Object
-
- com.github.f4b6a3.uuid.codec.uuid.DotNetGuid1Codec
-
-
Field Summary
Fields Modifier and Type Field Description static DotNetGuid1CodecINSTANCEA shared immutable instance.
-
Constructor Summary
Constructors Constructor Description DotNetGuid1Codec()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UUIDdecode(UUID uuid)Convert a .Net Guid to a time-based UUID (v1).UUIDencode(UUID uuid)Codec for .Net Guid.protected static UUIDtoAndFromDotNetGuid(UUID uuid)Convert a UUID to and from a .Net Guid.
-
-
-
Field Detail
-
INSTANCE
public static final DotNetGuid1Codec INSTANCE
A shared immutable instance.
-
-
Method Detail
-
encode
public UUID encode(UUID uuid)
Codec for .Net Guid. This codec converts a time-based UUID (v1) to a .Net Guid. It rearranges the most significant bytes from big-endian to little-endian, and vice-versa. The .Net Guid stores the most significant bytes as little-endian, while the least significant bytes are stored as big-endian (network order).
-
decode
public UUID decode(UUID uuid)
Convert a .Net Guid to a time-based UUID (v1). It rearranges the most significant bytes from big-endian to little-endian, and vice-versa. The .Net Guid stores the most significant bytes as little-endian, while the least significant bytes are stored as big-endian (network order).
-
toAndFromDotNetGuid
protected static UUID toAndFromDotNetGuid(UUID uuid)
Convert a UUID to and from a .Net Guid. It rearranges the most significant bytes from big-endian to little-endian, and vice-versa. The .Net Guid stores the most significant bytes as little-endian, while the least significant bytes are stored as big-endian (network order). ### References * How to Generate Sequential GUIDs for SQL Server in .NET https://blogs.msdn.microsoft.com/dbrowne/2012/07/03/how-to-generate-sequential-guids-for-sql-server-in-net/ * How are GUIDs sorted by SQL Server? http://sqlblog.com/blogs/alberto_ferrari/archive/2007/08/31/how-are-guids-sorted-by-sql-server.aspx- Parameters:
uuid- a UUID- Returns:
- another UUID
-
-