Function snarkos_cli::helpers::has_vanity_string

source ·
pub fn has_vanity_string(s: &str, vanity: &str) -> bool
Expand description

Check if a given vanity string exists at the start or end of the data part of a bech32m string.

The bech32m string must have the following format:

    <HRP>1<data>[<vanity string>]

where:

  • <HRP> is the human-readable part of the bech32m string.
  • 1 is the separator between the HRP and the data part.
  • <data> is the data part of the bech32m string.
  • <vanity string> is the vanity string to search for. This string may or may not be present at the start or end of the data part.

The function returns true if the vanity string exists at the start or end of the data part, and false otherwise.