Skip to content

malixsys/passwordHash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

passwordHash

GoDoc Build Status Go Report Card

Password hashing package compatible with Node's password-hash

Usage

package main
import "github.com/malixsys/passwordHash"

 func main() {
	 // Generate a hashed password
	 testPassword := `test1234`
	 hashedPassword := passwordHash.Generate(testPassword, nil)

	 // Test correct password in constant time
	 valid := passwordHash.Verify(hashedPassword, testPassword)
	 log.Printf("The password validity is %t against the hash", valid)

	 // Test incorrect password in constant time
	 valid, err = passwordHash.Verify(hashedPassword, "badPass")
	 log.Printf("The password validity is %t against the hash", valid)
 }

Development

Tests

Some tests are included

To run, use:

go test

TODO

  • Extend to other algorithms
  • More development info
  • More tests

Additional info

About

password-hash compatible functions for Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages