Sphire Mantis API Documentation

Sphire Mantis' API Documentation

View the Project on GitHub sphireinc/Mantis

Go Report Card Go Reference

encryption

import "github.com/sphireinc/mantis/encryption"

Index

Constants

Md5 are our enumerators Sha224 Sha256 Sha384 Sha512 Sha512224 Sha512256 Hmac512

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

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

type MHash

MHash our input/output tracking struct

type MHash struct {
    input     string
    isHashed  bool
    Output    string
    algorithm int8
}

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

Generated by gomarkdoc