Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenSalt ¶
GenSalt generate a salt if one doesn't exist of the length specified
Example ¶
package main import log "github.com/colt3k/nglog/ng" func main() { var dataset = []int{10, 20, 30, 5, 20} var data []byte for i, d := range dataset { if data != nil { data = GenSalt(data, d) } else { data = GenSalt(nil, d) } show(data, i, d) if i > 0 { data = nil } } } func show(data []byte, idx, size int) { log.Println(idx, "DataSize", len(string(data)), "should be:", size) }
Output:
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.