Documentation ¶
Index ¶
Constants ¶
View Source
const ( SHA256 hashAlg = iota HMAC_SHA256 Plaintext Flatmask )
Variables ¶
This section is empty.
Functions ¶
func ConcealWith ¶
Conceal runs one of clues' hashing algorithms on the provided string.
func Hide ¶
func Hide(a any) secret
Hide embeds the value in a secret struct where the Conceal() call contains a truncated hash of value. The hash function defaults to SHA256, but can be changed through configuration.
func HideAll ¶
func HideAll(a ...any) []secret
HideAll is a quality-of-life wrapper for transforming multiple values to secret structs.
Types ¶
type Concealer ¶
type Concealer interface { // Conceal produces an obfuscated representation of the value. Conceal() string // Concealers also need to comply with Format. // Complying with Conceal() alone doesn't guarantee that // the variable won't pass into fmt.Printf("%v") and skip // the whole conceal process. Format(fs fmt.State, verb rune) // PlainStringer is the opposite of conceal. // Useful for if you want to retrieve the raw value of a secret. PlainString() string }
Click to show internal directories.
Click to hide internal directories.