encryption

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 6 Imported by: 3

README

encryption

Go Version GoDoc codecov Go Report Card tests MIT license

Installation

go get github.com/go-packagist/encryption

Usage

package main

import (
	"fmt"
	"github.com/go-packagist/encryption"
)

func main() {
	e := encryption.NewEncrypter("EAFBSPAXDCIOGRUVNERQGXPYGPNKYATM")

	ciphertext, _ := e.Encrypt("test")
	plaintext, _ := e.Decrypt(ciphertext)

	fmt.Println(plaintext, ciphertext) // test 94Wpr_RCTTnDKw8u_zaqTsL8rr4=
}

License

The MIT License (MIT). Please see License File for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encrypter

type Encrypter struct {
	// contains filtered or unexported fields
}

func NewEncrypter

func NewEncrypter(key string) *Encrypter

func (*Encrypter) Decrypt

func (e *Encrypter) Decrypt(value string) (string, error)

func (*Encrypter) Encrypt

func (e *Encrypter) Encrypt(value string) (string, error)

Jump to

Keyboard shortcuts

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