common

package
v0.0.0-...-722ebc6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package common implements utility functions shared between other packages.

Index

Constants

View Source
const MimeJson = "application/json; charset=utf-8"
View Source
const MimePlain = "text/plain; charset=utf-8"

Variables

View Source
var Version = "trunk"

Functions

func HashPass

func HashPass(s string) ([]byte, error)

HashPass returns the bcrypt hash of the provided string. If an empty string is provided, return an empty string.

func IsValidURL

func IsValidURL(destURL string, logger *log.Logger) bool

IsValidURL returns true if the provided URL is a valid-looking HTTP or HTTPS URL.

func ValidatePass

func ValidatePass(pass string, hash []byte) bool

ValidatePass returns true if the password matches the bcrypt hash, false otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

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