core

package
v0.0.0-...-43e49cb Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

README

core

import "gitee.com/minph/siphan/core"

Overview

Export List

func Decrypt

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

解密 val 密文 key 密钥

func DecryptFromResult

func DecryptFromResult(encryptResult *EncryptResult) (string, error)

从加密结果直接解密

func DecryptFromSlice

func DecryptFromSlice(val string, codeSlice CodeSlice) (string, error)

type Code

type Code = diycode.Code

type CodeSlice

type CodeSlice = diycode.CodeSlice

type EncryptResult

type EncryptResult struct {
    // 密钥
    Key string
    // 密文
    Val string

    CodeSlice
}

加密结果

func Encrypt
func Encrypt(text string) (*EncryptResult, error)

加密

func EncryptFromSlice
func EncryptFromSlice(text string, codeSlice CodeSlice) (*EncryptResult, error)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

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

解密 val 密文 key 密钥

func DecryptFromResult

func DecryptFromResult(encryptResult *EncryptResult) (string, error)

从加密结果直接解密

func DecryptFromSlice

func DecryptFromSlice(val string, codeSlice CodeSlice) (string, error)

Types

type Code

type Code = diycode.Code

type CodeSlice

type CodeSlice = diycode.CodeSlice

type EncryptResult

type EncryptResult struct {
	// 密钥
	Key string
	// 密文
	Val string

	CodeSlice
}

加密结果

func Encrypt

func Encrypt(text string) (*EncryptResult, error)

加密

func EncryptFromSlice

func EncryptFromSlice(text string, codeSlice CodeSlice) (*EncryptResult, error)

Jump to

Keyboard shortcuts

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