Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladimir Barsukov
zGo
Commits
4b701a45
Commit
4b701a45
authored
1 year ago
by
Vladimir Barsukov
Browse files
Options
Download
Email Patches
Plain Diff
zguid
parent
3ed158cc
master
v1.6.4
v1.6.3
v1.6.2
v1.6.1
v1.6.0
v1.5.4
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zgo.go
+1
-0
zgo.go
zguid/zguid.go
+17
-0
zguid/zguid.go
with
18 additions
and
0 deletions
+18
-0
zgo.go
+
1
-
0
View file @
4b701a45
...
...
@@ -7,6 +7,7 @@ import (
_
"git.barsukov.pro/barsukov/zgo/zdb"
_
"git.barsukov.pro/barsukov/zgo/zdebug"
_
"git.barsukov.pro/barsukov/zgo/zgin"
_
"git.barsukov.pro/barsukov/zgo/zguid"
_
"git.barsukov.pro/barsukov/zgo/zjson"
_
"git.barsukov.pro/barsukov/zgo/zq"
_
"git.barsukov.pro/barsukov/zgo/zquit"
...
...
This diff is collapsed.
Click to expand it.
zguid/zguid.go
0 → 100644
+
17
-
0
View file @
4b701a45
package
zguid
import
(
"crypto/md5"
"fmt"
"github.com/google/uuid"
)
func
New
()
string
{
return
uuid
.
NewString
()
}
func
Hash
(
a
any
)
string
{
b
:=
md5
.
Sum
([]
byte
(
fmt
.
Sprintf
(
"%v"
,
a
)))
return
fmt
.
Sprintf
(
"%x%x%x%x-%x%x-%x%x-%x%x-%x%x%x%x%x%x"
,
b
[
0
],
b
[
1
],
b
[
2
],
b
[
3
],
b
[
4
],
b
[
5
],
b
[
6
],
b
[
7
],
b
[
8
],
b
[
9
],
b
[
10
],
b
[
11
],
b
[
12
],
b
[
13
],
b
[
14
],
b
[
15
])
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets