Skip to content

Instantly share code, notes, and snippets.

View sn4k3's full-sized avatar

Tiago Conceição sn4k3

  • Portugal
View GitHub Profile
@sn4k3
sn4k3 / Tuid.cs
Created August 6, 2023 19:42
A TUID is like a UUID (it conforms to UUID v4) but instead of being fully random (except for 6 bits for the version) it is prefixed with the time since epoch in microseconds.
using System.Buffers;
using System.Buffers.Text;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
namespace Types;
/// <summary>