ids

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenerateChallenge = func() string {
	return generateSecureRandomStr(64)
}
View Source
var GenerateRequestId = func() string {
	return generateSecureRandomStr(32)
}
View Source
var GenerateScheduleID = func() string {
	b := make([]byte, scheduleIDLength)
	for i := range b {
		b[i] = cryptoRandChar(groupIDCharset)
	}
	return string(b)
}

GenerateScheduleID mints a schedule ID. Kept short because it travels to the device on every schedule push and firmware bounds the field; drawn from the same lowercase alphanumeric charset as group IDs so it is unambiguous when a user reads it aloud.

Functions

func FormatUsername

func FormatUsername(identifier string) string

FormatUsername is the single canonical form (lower+trim) shared by the derived user_id, the stored email, and the email-index lookup key so they cannot drift.

func GenerateGroupID

func GenerateGroupID() string

GenerateGroupID generates a random group ID of 6 characters. The first character is guaranteed to be a lowercase letter, followed by 5 alphanumeric characters (lowercase letters and digits).

func GenerateSubGroupID

func GenerateSubGroupID() string

GenerateSubGroupID generates a random subgroup ID of 3 characters. The ID consists of lowercase letters and digits.

func NewUserID

func NewUserID() string

NewUserID mints an opaque user_id. Ids are generated rather than derived from a contact so an account is not tied to the email or phone it was created with: a person may verify a second contact, or change one, without the identifier moving.

Types

This section is empty.

Jump to

Keyboard shortcuts

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