password

package
v1.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encrypt

func Encrypt(password, saltString string, iterations int) string

MakePassword 用于将明文密码转为加密后的密码。这里没有判断密码是否为空。 django 密码加密算法的 go 语言版本。 Django 的实现细节请参考 Python 和 django 文档: django.contrib.auth.hashers.make_password django.utils.crypto import pbkdf2 hashlib.sha256 base64 参考:https://studygolang.com/articles/5262

func IsSame

func IsSame(password, encoded string) bool

IsSamePassword用来判断password字符串encode后是否与encoded一致 pbkdf2_sha256$120000$ONRhfKsUOHoF$xHEtXKw7u4F5hhdEj8sMUwHOcP06KBFliFnYzF7qYnw= 包括了4个部分,分别是: pbkdf2_sha256 100000 M1BIGL7NBnF1 gACxYtYQItPQ73FiWKYnYbCDdJeV2zlhobVcdkTd/Lg=

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL