encryption

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHasher

func NewHasher(salt string) (*hashids.HashID, error)

NewHasher creates a new hasher for decoding and encoding int64 slices

func ParseKey

func ParseKey(key []byte) ([]byte, error)

ParseKey parses an encryption key truncating it to the nearest 16 or 24 or 32 bit. If key is less 16 returns error

Types

type API

type API interface {
	Encrypt(data []byte) ([]byte, error)
	Decrypt(cipher []byte) ([]byte, error)
}

API is used for encryption and decryption

func NewAPI

func NewAPI(key []byte) (API, error)

NewAPI creates a symetric encryption/decryption API

Jump to

Keyboard shortcuts

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