app

package
v0.0.0-...-ac6d57d Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const HASH_LENGTH = 88

512 bits / 8 = 64 bytes * 8 / 6 = 86 plus padding for a multiple of 4 = 88

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App (application) implements the core business logic based on requirements which is to save hashed passwords and retrieve them later.

func New

func New(s store.Store) *App

New creates an application with the given Store implementation

func (*App) Close

func (app *App) Close() error

Close runs all tear down operations like closing the Store

func (*App) GetHash

func (app *App) GetHash(id int) (string, error)

GetHash returns the hash at the given id from the Store

func (*App) SetHash

func (app *App) SetHash(password string) (int, error)

SetHash receives a password to be hashed with SHA512 algorithm and then converted to base64 encoding and saved to the Store, returns the id where the hash is/will be saved.

Jump to

Keyboard shortcuts

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