Files
2024-04-21 22:47:51 +08:00

31 lines
850 B
C#
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#region Copyright (C) 2019 公众号:OSSCore
/***************************************************************************
*   文件功能描述:全局辅助类 - 唯一数字编号生成类
*
*   创建人: Kevin
* 创建人Email:1985088337@qq.com
*
*
*****************************************************************************/
#endregion
namespace OSS.Tools.Num;
/// <summary>
/// 唯一编码生成类
/// </summary>
public class SnowNumGenerator : BaseSnowNumGenerator
{
// 符号位(1位) + Timestamp(41位 最长70年) + WorkId(10) + sequence(12) = 编号Id (64位)
/// <summary>
/// 构造函数
/// </summary>
/// <param name="workId">当前的工作id 最大值不能超过(2^10 - 1)</param>
public SnowNumGenerator(int workId) : base(workId, 12, 10)
{
}
}