Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustUUIDv4 ¶
func MustUUIDv4() [16]byte
MustUUIDv4 generate uuid without allocations It will panic if it can't read random data.
It is safe calling this function from concurrent goroutines.
Example ¶
package main import ( "fmt" "github.com/rekby/fastuuid" ) func main() { var uuid [16]byte = fastuuid.MustUUIDv4() fmt.Println(uuid) }
Output:
func MustUUIDv4String ¶
func MustUUIDv4String() string
MustUUIDv4String generate uuid random string with only one allocation It will panic if it can't read random data.
It is safe calling this function from concurrent goroutines.
Example ¶
package main import ( "fmt" "github.com/rekby/fastuuid" ) func main() { fmt.Println(fastuuid.MustUUIDv4String()) }
Output:
func MustUUIDv4StringBytes ¶
func MustUUIDv4StringBytes(dst []byte)
MustUUIDv4StringBytes generate uuid and render it as string to dst buffer without allocations It will panic if it can't read random data.
It is safe calling this function from concurrent goroutines.
Example ¶
package main import ( "fmt" "github.com/rekby/fastuuid" ) func main() { buf := make([]byte, 36) fastuuid.MustUUIDv4StringBytes(buf) fmt.Println(string(buf)) }
Output:
func UUIDv4 ¶
UUIDv4 generate uuid as byte array without allocations in heap
It is safe calling this function from concurrent goroutines.
func UUIDv4String ¶
UUIDv4String generate uuid random string with only one allocation
It is safe calling this function from concurrent goroutines.
func UUIDv4StringBytes ¶
UUIDv4StringBytes generate uuid and render it as string to dst buffer without allocations
It is safe calling this function from concurrent goroutines.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
ibufio
Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O.
|
Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer object, creating another object (Reader or Writer) that also implements the interface but provides buffering and some help for textual I/O. |