2023-06-27 07:26:23 +00:00
|
|
|
package id_generator
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"math/rand"
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2023-07-03 09:33:59 +00:00
|
|
|
func GenSnNum() string {
|
2023-08-24 10:28:01 +00:00
|
|
|
a := fmt.Sprintf("%s%.8d", time.Now().UTC().Format("20060102150405.000"), rand.Intn(1000000))
|
2023-06-27 07:26:23 +00:00
|
|
|
return strings.ReplaceAll(a, ".", "")
|
|
|
|
}
|