Help us shape the future of Go! Take the 2026 Go Developer Survey

goshortcute

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: GPL-3.0 Imports: 11 Imported by: 2

README

goshortcute

goshortcute is a Go library for shorthand or shortcut to do something. This library created to help someone who lazy to write some codes, passing variable (string to []byte vice versa), checking map key or value (especially me, who write php code with a thousand func included such as in_array(), base64_encode(), md5() and more). New function will be added when i need to use it in my project and i want to share with public 😂 or you can contribute this project even create issue for new function that you want.

Installation

go get -u github.com/pobyzaarif/goshortcute

List of functions

  • goshortcute.StringSliceContains
  • goshortcute.StringtoBase64Decode
  • goshortcute.StringtoBase64Encode
  • goshortcute.StringtoMD5Hash

i thought the func name already represnted the functionality, so yaa i don't need to explain more 😂.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCBCDecrypt

func AESCBCDecrypt(encText, key []byte) (plainText string, err error)

AESCBCDecrypt : AES Decryption function Input : []byte("XyFYQ7yRapfsYEwYpqEuZA==") Key : []byte("testtesttesttesttesttesttesttest") Output : "1234567890" Error : nil

func AESCBCEncrypt

func AESCBCEncrypt(plainText, key []byte) (encText string, err error)

AESCBCEncrypt : AES Encryption function Input : []byte("1234567890") Key : []byte("testtesttesttesttesttesttesttest") Output : "XyFYQ7yRapfsYEwYpqEuZA==" Error : nil

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

PKCS7Padding : ...

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

PKCS7UnPadding : ...

func RandomAlphaNumeric

func RandomAlphaNumeric(digit int) string

RandomAlphaNumeric func to get random alphanumeric in x digits

func RandomAlphaNumericSpecialCharacter

func RandomAlphaNumericSpecialCharacter(digit int) string

RandomAlphaNumericSpecialCharacter func to get random alphanumeric and special character in x digits

func RandomNumber

func RandomNumber(digit int) string

RandomNumber func to get random number in x digits

func StringSliceContains

func StringSliceContains(a []string, x string) bool

StringSliceContains : tells whether a contains x

func StringtoBase64Decode

func StringtoBase64Decode(text string) string

StringtoBase64Decode : decode base64 string to text string. Input : "VGhpc0lzVGVzdDM=" Output : "ThisIsTest3"

func StringtoBase64Encode

func StringtoBase64Encode(text string) string

StringtoBase64Encode : encode text string to base64 string. Input : "ThisIsTest2" Output : "VGhpc0lzVGVzdDI="

func StringtoMD5Hash

func StringtoMD5Hash(text string) string

StringtoMD5Hash : encode text string to md5 string. Input : "ThisIsTest1" Output : "1fb81916b94ae73ddd71ac6fcf5a6e01"

func StringtoSHA256Hash

func StringtoSHA256Hash(text string) string

StringtoSHA256Hash : hash text string to SHA256 string. Input : "hello" Output : "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"

Types

This section is empty.

Jump to

Keyboard shortcuts

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