blocklist

package
v1.0.0-dev.5 Latest Latest
Warning

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

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

Documentation

Overview

Package blocklist holds the embedded list of common passwords access refuses, generated from SecLists by "go generate ./internal/blocklist", and the fold the password-context and common-password checks share.

Index

Constants

View Source
const SeclistsCommit = "f1196104c5594a19d78b486c52c0794b9d947993"

SeclistsCommit is the SecLists commit common.txt was generated from; go generate fetches the password lists at it. renovate: datasource=git-refs depName=seclists packageName=https://github.com/danielmiessler/SecLists branch=master

Variables

This section is empty.

Functions

func Contains

func Contains(password string) bool

Contains reports whether password, folded, is on the embedded list.

func Encode

func Encode(h *Header, entries []string) []byte

Encode renders h, with Kept and BodySHA256 taken from entries, a blank line, then one entry per line. Every entry must be non-empty and hold no newline, or Decode refuses the result.

func Fold

func Fold(s string) string

Fold returns s in the form the list holds and the password-context and common-password checks compare: NFC, then full Unicode case folding.

Types

type Header struct {
	URL           string // the source file at Commit
	Commit        string
	SourceSHA256  string
	BodySHA256    string // of every byte after the header's blank line
	MinRunes      int    // the shortest entry kept, in runes after Fold
	SourceEntries int    // non-empty lines in the source
	Survivors     int    // distinct folded entries of at least MinRunes
	Kept          int    // the first Survivors in the source's order, capped
}

Header is common.txt's provenance.

func Decode

func Decode(data string) (Header, []string, error)

Decode parses Encode's output. It refuses a malformed header or one missing a field, a body whose hash or entry count differs from the header, an empty body or entry, and a body without its final newline.

Jump to

Keyboard shortcuts

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