crypto

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 18 Imported by: 5 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashMe

func HashMe(in interface{}, hashType string) string

HashMe: This function handle a 'file' or '[]byte' as arguments. Returns the value Hash for the 'in'. The 'hashType' argument represents the targeted type: 'md5', 'sha256', 'sha512'.

func Md5File

func Md5File(filename string, devMode ...bool) (outMd5 string)

Md5File: Get MD5 checksum from file, 'devMode' means break on error.

func Md5String

func Md5String(inString string) (outMd5 string)

Md5String: Get MD5 checksum from string.

Types

type AES256CipherStruct

type AES256CipherStruct struct {
	Data        []byte // In/Out data store.
	InFilename  string
	OutFilename string
	// contains filtered or unexported fields
}

AES256CipherStruct: Structure that contain information for encrypting/ decrypting file or data. Result of string encryption is contained in Data

func (*AES256CipherStruct) Encrypt

func (c *AES256CipherStruct) Encrypt(passphrase string) error

func (*AES256CipherStruct) EncryptFile

func (c *AES256CipherStruct) EncryptFile(passphrase string) (err error)

func (*AES256CipherStruct) Uncrypt

func (c *AES256CipherStruct) Uncrypt(passphrase string) error

func (*AES256CipherStruct) UncryptFile

func (c *AES256CipherStruct) UncryptFile(passphrase string) (err error)

type Base64

type Base64 struct {
}

Base64: Structure that handle 'Encode' & 'Decode' method to/from 'Base64'.

func (*Base64) Decode

func (b *Base64) Decode(encoded string) (decoded []byte)

func (*Base64) Encode

func (b *Base64) Encode(data []byte) string

Jump to

Keyboard shortcuts

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