helpers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IDGeneratorFunc = func() string {
	return uniuri.NewLen(64)
}

IDGeneratorFunc returns a randomly generated string useable as identifier

View Source
var PrincipalHashFunc = func(principal string) string {

	hasher, err := blake2b.New512(principalHashKey)
	if err != nil {
		panic(err)
	}

	_, err = hasher.Write([]byte(principal))
	if err != nil {
		panic(err)
	}

	return base64.RawStdEncoding.EncodeToString(hasher.Sum(nil))
}

PrincipalHashFunc return the principal hashed using Blake2b keyed algorithm

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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