Skip to content

Commit 9f0d939

Browse files
committed
uuid生成改用更容易复制的base32
1 parent f6f8869 commit 9f0d939

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

uuid/uuid.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package uuid
22

33
import (
4-
"encoding/base64"
4+
"encoding/base32"
55
"encoding/binary"
66
"net"
77
"os"
@@ -35,5 +35,5 @@ func init() {
3535
func String() string {
3636
binary.BigEndian.PutUint64(buf[4:], uint64(time.Now().Unix()))
3737
binary.BigEndian.PutUint32(buf[12:], atomic.AddUint32(&inc, 1))
38-
return base64.RawURLEncoding.EncodeToString(buf)
38+
return base32.HexEncoding.WithPadding(base32.NoPadding).EncodeToString(buf)
3939
}

0 commit comments

Comments
 (0)