idem

package
v0.1.46 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 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 idem is what tells one request from another under one idempotency key (R17, R35): the key's form and the request's fingerprint.

A fingerprint is of the request as protobuf writes it deterministically, with its key left out, so that a repeat of one request has the fingerprint of its first, and its own key too: the learner's own key at a provider lives in the request's memory alone, and no hash of it is kept (R84 spec). Most are SHA-256. One of a request that carries a PIN or an age is argon2id with a salt of its own: a PIN has 10⁶ values and an age 18, so a fast hash of either would give it back, and the age is kept nowhere (privacy 3.3 spec).

Index

Constants

View Source
const MaxKey = 128

MaxKey is the longest key, in bytes, that a record keeps.

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(req proto.Message, slow bool) string

Fingerprint is the fingerprint of req: argon2id when slow, SHA-256 otherwise.

func Same

func Same(req proto.Message, fingerprint string) bool

Same says whether req is the request fingerprint was taken of.

func ValidKey

func ValidKey(key string) bool

ValidKey says whether key may be recorded: present, no longer than MaxKey, and with no NUL, which the database's text cannot hold.

Types

This section is empty.

Jump to

Keyboard shortcuts

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