Xor2Base64

package module
v0.0.0-...-920b1d8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

XorCrypto

简单的异或加密string

使用
go get github.com/BelieveR44/XorCrypto
简介

简单的Url参数加密

var XB = Xor2Base64{Key:"My key to Xor2Base64"}
EnString := XB.Encode("Your string")
YourString := XB.Decode(EnString)
fmt.Printf("YouString:%s\nEnString:%s\nDeString:%s\nKey:%s\n","Your string",EnString,YourString,XB.Key)
/*
YouString:Your string
EnString:FBZVGUUKVAYGTj8=
DeString:Your string
Key:My key to Xor2Base64
*/

使用的base64.RawURL 在URL传参的时候是安全的

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Xor2Base64

type Xor2Base64 struct {
	Key string
}

func (*Xor2Base64) Decode

func (xb *Xor2Base64) Decode(str string) string

func (*Xor2Base64) Encode

func (xb *Xor2Base64) Encode(str string) string

Jump to

Keyboard shortcuts

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