crypto

package
v0.0.0-...-9db4afe Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(str string) (string, error)

Base64Decode base64 decode

func Base64Encode

func Base64Encode(str string) string

Base64Encode base64 encode StdEncoding is the standard base64 encoding, as defined in RFC 4648.

func Base64Encode1

func Base64Encode1(str string) string

Base64Encode1 Base64Encode1

func GoogleAuth

func GoogleAuth(key string) uint32

GoogleAuth time slice is 30 second, if the key is invalid, return code is zero and ignore the error.

func MD5

func MD5(str ...string) string

MD5 生成字符串的MD5值

func TotpToken

func TotpToken(key string, interval int64) (uint32, int64, error)

TotpToken implements TOTP Algorithm, based on HOTP. HOTP(K,C) = Truncate(HMAC-SHA-1(K,C)) when C = (T -T0) / X, T0 is Unix epoch, X is Time slice length. TOTP = Truncate(HMAC-SHA-1(K, (T - T0) / X)) return params: token code<uint32>, time second remain<int64>, error<error>

Types

This section is empty.

Jump to

Keyboard shortcuts

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