password/

directory
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT

README

PTGU Password

Import

import (
	PTGUpassword "github.com/parinyapt/golang_utils/password/v1"
)

Example

Hash Password & Verify Password v1
func main() {
	var password string = "123456789"

	passwordHash, err := PTGUpassword.HashPassword(password, 14)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(password + " : " + passwordHash)

	IsMatch := PTGUpassword.VerifyHashPassword(password, passwordHash)
	if IsMatch {
		fmt.Println("Password match")
	}else{
		fmt.Println("Password not match")
	}

	IsMatch := PTGUpassword.VerifyHashPassword("123456", passwordHash)
	if IsMatch {
		fmt.Println("Password match")
	}else{
		fmt.Println("Password not match")
	}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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