Skip to content

thomasvvugt/fiber-hashing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fiber Hashing

A hashing library built for Fiber. Supports both argon2id and bcrypt, uses argon2id by default.

Example

package main

import (
	"github.com/gofiber/fiber/v3"
	"github.com/thomasvvugt/fiber-hashing"
)

func main() {
	app := fiber.New()

	hasher := hashing.New()

	app.Get("/", func(c fiber.Ctx) error {
		hash, _ := hasher.CreateHash("ourlittlesecret")
		return c.SendString(hash)
	})

	app.Get("/match/*", func(c fiber.Ctx) error {
		match, _ := hasher.MatchHash("ourlittlesecret", c.Params("*"))
		if match {
			return c.SendString("Matches!")
		}
		return c.SendString("Does not match :c")
	})

	app.Listen(":3000")
}

About

A hashing library built for Fiber

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages