Documentation
¶
Index ¶
- Constants
- Variables
- func AESDecrypt(baseStr string) string
- func AESDecrypt2(cipherkey, ciphertext []byte) ([]byte, error)
- func AESEncrypt(originPWD []byte) string
- func AESEncrypt2(cipherkey, src []byte) []byte
- func CheckPWD(password, enPassword string) bool
- func FmtRolePrefix(sub interface{}) string
- func Md5(b []byte) string
- func Ripemd160(bytes []byte) []byte
- func Sha256(bytes []byte) []byte
- func StampToTime(st int64) time.Time
- func XXHash(bytes []byte) []byte
Constants ¶
const ( // 时间格式化字符串 SysTimeform string = "2006-01-02 15:04:05" SysTimeformShort string = "2006-01-02" )
前面是含义,后面是 go 的表示值,多种表示,逗号","分割 年 06,2006 月份 1,01,Jan,January 日 2,02,_2 时 3,03,15,PM,pm,AM,am 分 4,04 秒 5,05 周几 Mon,Monday 时区时差表示 -07,-0700,Z0700,Z07:00,-07:00,MST 时区字母缩写 MST 您看出规律了么!哦是的,你发现了,这里面没有一个是重复的,所有的值表示都唯一对应一个时间部分。 并且涵盖了很多格式组合。
Variables ¶
var SysTimeLocation, _ = time.LoadLocation("Asia/Chongqing")
中国时区
Functions ¶
func AESDecrypt ¶
----------------------------------------------------------- ----------------------- 解密 ------------------------------ ----------------------------------------------------------- 先base64转码,再解密
func AESDecrypt2 ¶
AESDecrypt decrypts a piece of data. The cipherkey argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
func AESEncrypt ¶
----------------------------------------------------------- ----------------------- 加密 ------------------------------ ----------------------------------------------------------- 加密后再base64编码成string
func AESEncrypt2 ¶
AESEncrypt encrypts a piece of data. The cipherkey argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
func FmtRolePrefix ¶
func FmtRolePrefix(sub interface{}) string
Types ¶
This section is empty.