utils

package module
v0.0.0-...-7b1c8a9 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: BSD-3-Clause, MIT Imports: 5 Imported by: 4

README

Utils

Build Status GoDoc

Utils package for Golang.

Documentation

https://godoc.org/github.com/clevergo/utils

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StdChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")

Functions

func Bytes2String

func Bytes2String(b []byte) string

b2s converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .

Note it may break if string and/or slice header will change in the future go versions.

func RandomBytes

func RandomBytes(length int) []byte

Generate random []byte. @length length of []byte.

func RandomChars

func RandomChars(length int, args ...[]byte) (string, error)

func String2Bytes

func String2Bytes(s string) []byte

s2b converts string to a byte slice without memory allocation.

Note it may break if string and/or slice header will change in the future go versions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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