|
package helper
|
|
|
|
import (
|
|
"strconv"
|
|
"time"
|
|
|
|
"github.com/bwmarrin/snowflake"
|
|
)
|
|
|
|
func GenerateIDString() (string, error) {
|
|
node, err := snowflake.NewNode(time.Now().UnixMilli() % 1023)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return strconv.FormatInt(node.Generate().Int64(), 36), nil
|
|
}
|