encryption

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 11 Imported by: 0

README

Sphire Mantis::Encryption

The Encryption package of Mantis provides helper functions for encryption.

Documentation

Index

Constants

View Source
const (
	Md5 int8 = iota
	Sha224
	Sha256
	Sha384
	Sha512
	Sha512224
	Sha512256
	Hmac512
)

Md5 are our enumerators Sha224 Sha256 Sha384 Sha512 Sha512224 Sha512256 Hmac512

Variables

This section is empty.

Functions

func CreateRandomBytes

func CreateRandomBytes(bytes int) []byte

CreateRandomBytes creates a random bytes of bytes int

func CreateRandomString

func CreateRandomString(bytes int) string

CreateRandomString generates a random string of n bytes

Types

type MHash

type MHash struct {
	Output string
	// contains filtered or unexported fields
}

MHash our input/output tracking struct

func New

func New(input string, algorithm int8) *MHash

New returns an instance of MHash given our input and algorithm

func (*MHash) Algorithm

func (h *MHash) Algorithm() (int8, string)

Algorithm returns the chosen algorithm as a string and int

func (*MHash) GetInput

func (h *MHash) GetInput() string

GetInput returns the initial input

func (*MHash) GetOutput

func (h *MHash) GetOutput() string

GetOutput returns the hashed output

func (*MHash) Hash

func (h *MHash) Hash()

Hash performs our hash, fills in Output, and unsets input

func (*MHash) IsHashed

func (h *MHash) IsHashed() bool

IsHashed tells us whether our MHash has been MHash()'d

func (*MHash) MarshalJSON

func (h *MHash) MarshalJSON() ([]byte, error)

MarshalJSON implements the JSON encoding interface

Jump to

Keyboard shortcuts

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