16 Commits

7 changed files with 17 additions and 20 deletions
-10
View File
@@ -1,10 +0,0 @@
kind: pipeline
type: docker
name: default
steps:
- name: build
pull: if-not-exists
image: golang
commands:
- go build idkey.go
+2
View File
@@ -1 +1,3 @@
.idea/
.vscode/
.devcontainer/
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 xiaoqidun
Copyright (c) 2020-2026 肖其顿 (XIAO QI DUN)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+5 -1
View File
@@ -1,7 +1,11 @@
# idkey [![PkgGoDev](https://pkg.go.dev/badge/github.com/xiaoqidun/idkey)](https://pkg.go.dev/github.com/xiaoqidun/idkey)
Golang Argon2id 密码hash和验证
Go语言Argon2id密码哈希和验证
# 安装方法
```shell
go get -u github.com/xiaoqidun/idkey
```
# 使用方法
```go
// 生成argon2id hash密码
+3 -3
View File
@@ -1,7 +1,7 @@
module github.com/xiaoqidun/idkey
go 1.20
go 1.25.0
require golang.org/x/crypto v0.18.0
require golang.org/x/crypto v0.49.0
require golang.org/x/sys v0.16.0 // indirect
require golang.org/x/sys v0.42.0 // indirect
+4 -4
View File
@@ -1,4 +1,4 @@
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
+2 -1
View File
@@ -6,8 +6,9 @@ import (
"encoding/base64"
"errors"
"fmt"
"golang.org/x/crypto/argon2"
"strings"
"golang.org/x/crypto/argon2"
)
// Data 密文编码结构