Skip to content

go-passwd/hasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Password hasher library for Go

Build Status Coverage Status Go Report Card GoDoc

Installation

go get -u github.com/go-passwd/hasher

Usage

hshr := hasher.New(hasher.TypeSHA512)
hshr.SetPassword(plainTextPassword)
hashedPassword := hshr.String()

Hashers

PlainHasher

Stored password as plain text.

passwordHasher := hasher.New(hasher.TypePlain)

MD5Hasher

Store password as MD5 hash.

passwordHasher := hasher.New(hasher.TypeMD5)

SHA1Hasher

Store password as SHA-1 hash.

passwordHasher := hasher.New(hasher.TypeSHA1)

SHA224Hasher

Store password as SHA-224 hash.

passwordHasher := hasher.New(hasher.TypeSHA224)

SHA256Hasher

Store password as SHA-256 hash.

passwordHasher := hasher.New(hasher.TypeSHA256)

SHA384Hasher

Store password as SHA-384 hash.

passwordHasher := hasher.New(hasher.TypeSHA384)

SHA512Hasher

Store password as SHA-512 hash.

passwordHasher := hasher.New(hasher.TypeSHA512)

SHA512_224Hasher

Store password as SHA-512/224 hash.

passwordHasher := hasher.New(hasher.TypeSHA512_224)

SHA512_256Hasher

Store password as SHA-512/256 hash.

passwordHasher := hasher.New(hasher.TypeSHA512_256)