Countersign.Hint (Countersign v0.1.0)

Copy Markdown View Source

The masked form of a delivery address, the only form a screen shows: m•••@gmail.com for an email, •••-•••-0142 for a phone number.

Summary

Functions

Masks an email address down to its first character and its domain.

The hint for address on channel ("email" or "sms").

Masks a phone number down to its last four digits.

Functions

email(address)

@spec email(String.t()) :: String.t()

Masks an email address down to its first character and its domain.

hint(binary, address)

@spec hint(String.t(), String.t()) :: String.t()

The hint for address on channel ("email" or "sms").

iex> Countersign.Hint.hint("email", "Mary.Smith@Gmail.com")
"m•••@gmail.com"

iex> Countersign.Hint.hint("sms", "+1 (303) 555-0142")
"•••-•••-0142"

phone(number)

@spec phone(String.t()) :: String.t()

Masks a phone number down to its last four digits.