utils

package
v0.0.0-...-127461d Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandom

func GenerateRandom(randomType Type) (string, error)

GenerateRandom generates a random string for either password or salt

func GenerateRandomLength

func GenerateRandomLength(length int, randomType Type) (string, error)

func GetTest2

func GetTest2() string

func HashPass

func HashPass(password, salt []byte, iter, keyLen int) []byte

func HashPassScrypt

func HashPassScrypt(password, salt []byte, workFactor, blockSize, parallelismFactor, keyLen int) (string, error)

func PSQL

func PSQL() sq.StatementBuilderType

func PSQL1

func PSQL1() sq1.StatementBuilderType

Types

type Characters

type Characters string
const (
	UsernameCharacters Characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	SaltCharacters     Characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/."
	PasswordCharacters Characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@*()&"
)

type Length

type Length int
const (
	PasswordLength Length = 12
	SaltLength     Length = 22
	UsernameLength Length = 20
)

type MyUtils

type MyUtils struct {
	Test     string
	GetTest1 func() string
}

func (*MyUtils) GetDay

func (m *MyUtils) GetDay(t int64) string

func (*MyUtils) GetNextSalt

func (m *MyUtils) GetNextSalt() ([]byte, error)

func (*MyUtils) GetTest

func (m *MyUtils) GetTest() string

func (*MyUtils) GetTime

func (m *MyUtils) GetTime() int64

func (*MyUtils) GetTime1Day

func (m *MyUtils) GetTime1Day() int64

func (*MyUtils) GetYear

func (m *MyUtils) GetYear() int

type Type

type Type int
const (
	GeneratePassword Type = iota
	GenerateSalt
	GenerateUsername
)

Directories

Path Synopsis
Package squirrel provides a fluent SQL generator.
Package squirrel provides a fluent SQL generator.

Jump to

Keyboard shortcuts

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