common

package
v0.0.0-...-9539eb3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(password string, saltSize int, iterations int, algorithm string) (string, error)

Generate the hash of a password for storage in the database. NOTE: We store the details of the hashing algorithm with the hash itself, making it easy to recreate the hash for password checking, even if we change the default criteria here. Taken from brocaar's lora-app-server: https://github.com/brocaar/lora-app-server

func HashCompare

func HashCompare(password string, passwordHash string) bool

HashCompare verifies that passed password hashes to the same value as the passed passwordHash. Taken from brocaar's lora-app-server: https://github.com/brocaar/lora-app-server

func OpenDatabase

func OpenDatabase(dsn, engine string) (*sqlx.DB, error)

OpenDatabase opens the database and performs a ping to make sure the database is up. Taken from brocaar's lora-app-server: https://github.com/brocaar/lora-app-server

func TopicsMatch

func TopicsMatch(savedTopic, givenTopic string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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