invite

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package invite is the invite codes of the closed slice (R04, R34): how a code is made, how one given back is read, and the SHA-256 that is all the database keeps of it.

A code is 16 symbols of Crockford's base32, 80 bits from crypto/rand, written in four groups of four: 0123-4567-89AB-CDEF. It is read as Crockford reads it, so that what a person types or pastes back is taken: case, dashes and white space — a line's end, a space of no break — do not count, O is read as 0, and I and L as 1. The hash is of the code so read, so that every way of writing it has one.

Index

Constants

View Source
const (
	// ClosedSlice is the tariff of the closed slice, a code's by default.
	ClosedSlice = "closed_slice"
)

The tariffs a code is made with (R11; architecture 3.6). A code's tariff passes to the account that redeems it. Their caps come with the quota (Д11).

View Source
const (
	// Symbols is how many symbols of the alphabet a code has.
	Symbols = 16
)

The shape of a code.

Variables

View Source
var Tariffs = []string{ClosedSlice}

Tariffs is every tariff a code may be made with.

Functions

func Known

func Known(tariff string) bool

Known says whether tariff is one of Tariffs.

Types

type Hash

type Hash [sha256.Size]byte

Hash is what the database keeps of a code: its SHA-256.

func New

func New() (string, Hash)

New is a new code, as it is written for the person who gets it, and its hash. crypto/rand never fails on the platforms api runs on.

func Read

func Read(given string) (Hash, bool)

Read is the hash of a code as it was given back, and false for what is no code: a symbol out of the alphabet, or too few or too many of them.

Jump to

Keyboard shortcuts

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