Categorygithub.com/junxie6/util
modulepackage
0.0.0-20210123031937-b944ef001ec9
Repository: https://github.com/junxie6/util.git
Documentation: pkg.go.dev

# README

util

# Functions

AbsWithBranch returns the absolute value of x.
AbsWithTwosComplement returns the absolute value of x.
Atoi ...
Atoi64 ...
ByteSliceEqual tells whether a and b contain the same elements.
BytesToPrivateKey bytes to private key.
BytesToPublicKey bytes to public key.
CloneByteSlice ..
CloneIntSlice ...
Close is used for defer statement.
ConvErrArrToJSON ...
ConvErrArrToStringArr ...
ConvSliceToInterface ...
No description provided by the author
CopyIntSlice ...
CreateHash ...
No description provided by the author
DecodeJSONStreamMap ...
DecodeJSONStreamStruct ...
DecryptAES ...
DecryptWithPrivateKey decrypts data with private key.
DeferClose ..
EchoColor ...
EncryptAES ...
EncryptWithPublicKey encrypts data with public key.
ExecCommand ...
FormValueArr ...
GenerateKeyPair generates a new key pair.
GenerateRandomBytes returns securely generated random bytes.
GenerateRandomString returns a URL-safe, base64 encoded securely generated random string.
GetEnv ...
GetSliceHeader ...
HashPassword ...
HMACHash hashes data using a secret key.
InArrayInt ...
InArrayStr ...
InArrayV1 ...
InArrayV2 ...
IntSliceEqual tells whether a and b contain the same elements.
IntToDigitArr separates the digits of an integer into a slice Reference: https://stackoverflow.com/questions/1613317/fastest-way-to-separate-the-digits-of-an-int-into-an-array-in-net https://stackoverflow.com/questions/4261589/how-do-i-split-an-int-into-its-digits.
JSONDeepEqual ...
No description provided by the author
NumOfDigitsDivideAndConquer (Divide and conquer approach) ..
NumOfDigitsDivideAndConquerHardCoded (Divide and conquer hard-coded approach) ...
NumOfDigitsLog10 (log10 approach) ..
NumOfDigitsRepeatedDivide (repeated divide approach) ...
NumOfDigitsString (string approach) ...
Placeholder generates the placeholders for SQL query.
Pow computes a**b using binary powering algorithm See Donald Knuth, The Art of Computer Programming, Volume 2, Section 4.6.3.
PowOfTenArr ...
PrintErrJSON ...
PrintJSON ...
PrintStructJSON ...
PrivateKeyToBytes private key to bytes.
PublicKeyToBytes public key to bytes.
RandomDate ...
RandomNumber generates a random number in a given range.
RandomNumInSlice ...
RandStringBytes ...
RandStringRunes ...
No description provided by the author
No description provided by the author
No description provided by the author
SignSignature signs the data with a private key.
SliceFill fills a slice with values.
StrToUint32 converts uint32 string to uint32 integer.
StructFieldNameArr ...
StrutToSliceOfFieldAddress can be used for rows.Scan() for setting the value for database fields from SQL query.
Uint32ToStr converts uint32 integer to string.
ValidatePassword ...
VerifySignature verifies the data with a public key.
WaitForServer attempts to contact the server of a URL.
No description provided by the author

# Variables

FGColor ...