wphash

package module
v0.0.0-...-daa5551 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 4 Imported by: 0

README

wordpress-hash-go

WordPress hashes implemented with Golang

Usage

Start use it

Download and install

$ go get github.com/thundernet8/wordpress-hash-go

Import it in your code

import (
    wphash "github.com/thundernet8/wordpress-hash-go"
)

Canonical example:

package main

import (
	"fmt"

	wphash "github.com/thundernet8/wordpress-hash-go"
)

func main() {
	password := "123456"
	// hash password
	hash := wphash.HashPassword(password)
	fmt.Printf("Password <%s> hash result is <%s>", password, hash)

	// verify password and hash
	match := wphash.CheckWordPressPasswordHash(password, "$P$BmIaPlVaAl6kEsffVZGdASCVH.i1cZ0")
	fmt.Printf("Check password <%s> with hash <%s> result is %t", match)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWordPressPasswordHash

func CheckWordPressPasswordHash(password string, hash string) bool

Verify user submmited password and db password hash

func HashPassword

func HashPassword(password string) string

Hash password

Types

This section is empty.

Jump to

Keyboard shortcuts

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