Documentation ¶
Index ¶
- Constants
- func CeilInt(x float32) int
- func CeilInt64(x float64) int64
- func CeilUint64(x float64) uint64
- func Decrypt(key []byte, iv []byte, ciphertext []byte) ([]byte, error)
- func Encrypt(key []byte, iv []byte, cleartext []byte) ([]byte, error)
- func GenAESKey() []byte
- func GenIV() []byte
- func GenKey(length int) []byte
- func IncrementBytes(bytes []byte)
- func IncrementBytesByCount(bytes []byte, count int)
- func MaxInt(a int, b int) int
- func MaxInt64(a int64, b int64) int64
- func MinInt(a int, b int) int
- func MinInt64(a int64, b int64) int64
- func RandomBytes(length int) []byte
- func RandomString(length int) string
- func SHA256Hex(val string) string
- func ScanInt(scanner *bufio.Scanner) (int, error)
- func SliceHasString(haystack []string, needle string) bool
- func Weakhash(username string, password string) string
- type ReadSeekCloser
Constants ¶
View Source
const ( AES_KEY_LENGTH = 32 DEFAULT_KEY_LENGTH = AES_KEY_LENGTH IV_LENGTH = 12 // Pretty standard size (bytes). )
View Source
const (
RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
)
Variables ¶
This section is empty.
Functions ¶
func CeilUint64 ¶
func IncrementBytes ¶
func IncrementBytes(bytes []byte)
"Increment" the byte silce by going through each byte (big endian) and incremnt it. If the byte does not roll over to zero, then stop there.
func IncrementBytesByCount ¶
func RandomBytes ¶
func RandomString ¶
func SliceHasString ¶
Uses standard n search and equality.
Types ¶
Click to show internal directories.
Click to hide internal directories.