Documentation
¶
Index ¶
- func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)
- func ConvertValidationError(err validator.ValidationErrors) error
- func GenerateCertificate(privateKey any, publicKey any, expireAt time.Time, ...) ([]byte, error)
- func GenerateECDSAKey(curve elliptic.Curve) (*ecdsa.PrivateKey, []byte, error)
- func GenerateRSAKey(bitSize int) (*rsa.PrivateKey, []byte, error)
- func HashFileMD5(file io.Reader) (string, error)
- func RandomNumber(amount int) int
- func RandomPassPhrase(length int, concatSymbol string) (string, error)
- func RandomSaltString(size int) (string, error)
- func RandomString(length int) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertValidationError ¶
func ConvertValidationError(err validator.ValidationErrors) error
ConvertValidationError converts a validator.ValidationErrors object into a single error message. It extracts the invalid field names from the validation errors and concatenates them into a single string.
Parameters:
- err: a validator.ValidationErrors object containing the validation errors.
Returns:
- An error object with a formatted message listing the invalid fields.
func GenerateCertificate ¶
func GenerateECDSAKey ¶
func GenerateRSAKey ¶
func GenerateRSAKey(bitSize int) (*rsa.PrivateKey, []byte, error)
func HashFileMD5 ¶
HashFileMD5 computes the MD5 hash of the content read from the provided io.Reader.
Parameters:
- file: an io.Reader representing the file content to be hashed.
Returns:
- A string representing the MD5 hash in hexadecimal format.
- An error if there is any issue during hashing.
func RandomNumber ¶
func RandomSaltString ¶
func RandomString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.