Replace README with markdown version.
This commit is contained in:
parent
e810e021c7
commit
455ea53f19
@ -1,7 +1,7 @@
|
|||||||
PACKAGE
|
Package uniuri
|
||||||
|
=====================
|
||||||
|
|
||||||
package uniuri
|
import "github.com/dchest/uniuri"
|
||||||
import "github.com/dchest/uniuri"
|
|
||||||
|
|
||||||
Package uniuri generates random strings good for use in URIs to identify
|
Package uniuri generates random strings good for use in URIs to identify
|
||||||
unique objects.
|
unique objects.
|
||||||
@ -20,37 +20,48 @@ Functions read from crypto/rand random source, and panic if they fail to
|
|||||||
read from it.
|
read from it.
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS
|
Constants
|
||||||
|
---------
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Standard length of uniuri string to achive ~95 bits of entropy.
|
// Standard length of uniuri string to achive ~95 bits of entropy.
|
||||||
StdLen = 16
|
StdLen = 16
|
||||||
// Length of uniurl string to achive ~119 bits of entropy, closest
|
// Length of uniurl string to achive ~119 bits of entropy, closest
|
||||||
// to what can be losslessly converted to UUIDv4 (122 bits).
|
// to what can be losslessly converted to UUIDv4 (122 bits).
|
||||||
UUIDLen = 20
|
UUIDLen = 20
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
VARIABLES
|
|
||||||
|
|
||||||
var StdChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890")
|
Variables
|
||||||
|
---------
|
||||||
|
|
||||||
|
var StdChars = []byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
|
||||||
|
|
||||||
Standard characters allowed in uniuri string.
|
Standard characters allowed in uniuri string.
|
||||||
|
|
||||||
|
|
||||||
FUNCTIONS
|
Functions
|
||||||
|
---------
|
||||||
|
|
||||||
func New() string
|
### func New
|
||||||
|
|
||||||
|
func New() string
|
||||||
|
|
||||||
New returns a new random string of the standard length, consisting of
|
New returns a new random string of the standard length, consisting of
|
||||||
standard characters.
|
standard characters.
|
||||||
|
|
||||||
func NewLen(length int) string
|
### func NewLen
|
||||||
|
|
||||||
|
func NewLen(length int) string
|
||||||
|
|
||||||
NewLen returns a new random string of the provided length, consisting of
|
NewLen returns a new random string of the provided length, consisting of
|
||||||
standard characters.
|
standard characters.
|
||||||
|
|
||||||
func NewLenChars(length int, chars []byte) string
|
### func NewLenChars
|
||||||
|
|
||||||
|
func NewLenChars(length int, chars []byte) string
|
||||||
|
|
||||||
NewLenChars returns a new random string of the provided length, consisting
|
NewLenChars returns a new random string of the provided length, consisting
|
||||||
of the provided byte slice of allowed characters (maximum 256).
|
of the provided byte slice of allowed characters (maximum 256).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user