-- import "github.com/nullboundary/utilbelt"
func CalcHMAC(message string, key []byte) []byteCalcHMAC makes an HMAC of a message and key
--
func DebugPrintJson(Data interface{})DebugPrintJson prints json data for debugging
--
func DecodeUriToBytes(str string, fileType string) (string, []byte)DecodeUriToBytes decodes a data uri into bytes
--
func DecryptAESCFB(key []byte, cryptoText string) stringDecryptAESCFB decrypts from base64 to decrypted string
--
func EncodetoDataUri(fileName string, mimeType string, allowTypes ...string) (string, error)EncodetoDataUri reads a file and generates a data uri
--
func EncryptAESCFB(key []byte, text string) stringEncryptAESCFB encrypts string to base64 crypto using AES
--
func GenerateFnvHashID(hashSeeds ...string) uint32GenerateFnvHashID generates a hash fnv1a hash. Fast, unique, but insecure! use only for ids and such. https://programmers.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed
--
func GenerateToken(key []byte, seeds ...string) stringGenerateToken creates a urlEnocded hmac token
--
func GetEtcdKey(key string) (string, error)GetEtcdKey retrives key/value pairs from etcd disrtibuted store
--
func HashSha1Bytes(hashBytes []byte) []byteHashSha1Bytes computes a Sha1 hash of byte data
--
func HashSha1Json(jsonData interface{}) []byteHashSha1Json computes a Sha1 hash of json data
--
func HeartBeatEtcd(key string, value string, ttl int)HeartbeatEtcd sets key/value pairs to etcd disrtibuted store at an interval Used to renew a ttl set
--
func JsonErrorResponse(res http.ResponseWriter, err error, status int)JsonErrorResponse writes your error to response with a specific http status
--
func RandomStr(n int) stringRandomStr generates a string of random letters and numbers with crypto/rand
--
func ReadJson(req *http.Request, data interface{}) errorReadJson read json from request and marshal the data
--
func SetEtcdKey(key string, value string, ttl int) errorSetEtcdKey sets key/value pairs to etcd disrtibuted store
--
func SetEtcdURL(etcdURL ...string) stringSetEtcdURL sets the url address and port of the etcd service from environment variables
--
func VerifyHMAC(message string, macOfMessage []byte, key []byte) boolVerifyHMAC verifies a HMAC message
--
func VerifyToken(key []byte, authToken string, seeds ...string) (bool, error)VerifyToken returns true if token has a valid HMAC.
--
func WriteJson(res http.ResponseWriter, dataOut interface{}, pretty bool) errorWriteJson writes json to response with http.StatusOK
--
func WriteJsonStatus(res http.ResponseWriter, status int, dataOut interface{}, pretty bool) errorWriteJsonStatus writes json to response and set specfic http status code