5 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.41.0
require golang.org/x/crypto v0.49.0
require golang.org/x/sys v0.35.0 // indirect
require golang.org/x/sys v0.42.0 // indirect
+4 -4
View File
@@ -1,4 +1,4 @@
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
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 密文编码结构