go get -u github.com/go-passwd/hasher
hshr := hasher.New(hasher.TypeSHA512)
hshr.SetPassword(plainTextPassword)
hashedPassword := hshr.String()
Stored password as plain text.
passwordHasher := hasher.New(hasher.TypePlain)
Store password as MD5 hash.
passwordHasher := hasher.New(hasher.TypeMD5)
Store password as SHA-1 hash.
passwordHasher := hasher.New(hasher.TypeSHA1)
Store password as SHA-224 hash.
passwordHasher := hasher.New(hasher.TypeSHA224)
Store password as SHA-256 hash.
passwordHasher := hasher.New(hasher.TypeSHA256)
Store password as SHA-384 hash.
passwordHasher := hasher.New(hasher.TypeSHA384)
Store password as SHA-512 hash.
passwordHasher := hasher.New(hasher.TypeSHA512)
Store password as SHA-512/224 hash.
passwordHasher := hasher.New(hasher.TypeSHA512_224)
Store password as SHA-512/256 hash.
passwordHasher := hasher.New(hasher.TypeSHA512_256)