public class SnowflakeUtil extends Object
| Constructor and Description |
|---|
SnowflakeUtil() |
| Modifier and Type | Method and Description |
|---|---|
static long |
genId() |
protected static int |
getDataId()
根据 host name 取余,发生异常就获取 0到31之间的随机数
|
protected static int |
getWorkId()
根据 host address 取余,发生异常就获取 0到31之间的随机数
|
static long |
nextMillis(long lastMillis)
获取下一不同毫秒的时间戳,不能与最后的时间戳一样
|
Copyright © 2025. All rights reserved.