caesarKit

package
v2.1.58 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipherText string, shift uint8) string

func DecryptWithRawURLBase64

func DecryptWithRawURLBase64(str string, shift uint8) (string, error)

DecryptWithRawURLBase64

流程: (1) 凯撒密码解密 (2) base64解码(base64.RawURLEncoding)

func Encrypt

func Encrypt(plainText string, shift uint8) string

Encrypt 凯撒密码加密.

PS: 仅加密大小写的英文字母.

@param shift 推荐值: (1) [0, 25]

(2) 不推荐使用 26*n(n >= 0),因为这样加密了个寂寞

func EncryptWithRawURLBase64

func EncryptWithRawURLBase64(str string, shift uint8) string

EncryptWithRawURLBase64

PS: 本函数对 Encrypt 就行了封装,好处: 对所有字符进行加密.

流程: (1) base64编码(base64.RawURLEncoding) (2) 凯撒密码加密

Types

This section is empty.

Jump to

Keyboard shortcuts

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