dcrypto

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 9 Imported by: 0

README

dcrypt

简单的AES加解密组件,主要用于auth-key的生成

how to use

    key := "test_key"
    plainText := "example123/.,"
	cipherText, err := Encrypt(plainText, key)
    // 密文cipherText = "dcrypto-ab940f8d0abbcc20c9216d163bf6e5500bc22d5cdd1ee6a5a3ac705b2e"
	res, err := Decrypt(cipherText, key)

bench_mark

BenchmarkEncrypt-4        500000          2577 ns/op
BenchmarkDecrypt-4       1000000          1394 ns/op

Documentation

Overview

Package dcrypto ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipherText, key string) (string, error)

Decrypt return ori str

func Encrypt

func Encrypt(plainText, key string) (string, error)

Encrypt return enc str

Types

This section is empty.

Jump to

Keyboard shortcuts

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