keygen

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package keygen provides functionality for generating API client IDs and secrets

Index

Constants

View Source
const (
	KeyIDLength  = 32
	SecretLength = 64
	ByteLength   = 8
)

Defaults for the length of key IDs and secrets in Datum

Variables

This section is empty.

Functions

func Alpha

func Alpha(n int) string

Alpha generates a random string of n characters that only includes upper and lowercase letters (no symbols or digits)

func AlphaNumeric

func AlphaNumeric(n int) string

AlphaNumeric generates a random string of n characters that includes upper and lowercase letters and the digits 0-9

func CryptoRandInt

func CryptoRandInt() uint64

CryptoRandInt function generates a random 64-bit unsigned integer using cryptographic methods

func KeyID

func KeyID() string

KeyID returns a random ID that is of a fixed length with only alpha characters

func Secret

func Secret() string

Secret returns a random string of a fixed length with alpha-numeric characters

Types

This section is empty.

Jump to

Keyboard shortcuts

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