libzypp 17.31.23
|
Random art fingerprint visualization Visualize fingerprint data on a [17x9] (SSH) or [19x11] (GPG) or custom sized board. More...
#include <base/DrunkenBishop.h>
Classes | |
class | Impl |
DrunkenBishop implementation. More... | |
Public Types | |
enum | OptionBits { USE_COLOR = (1<<0) } |
Public Member Functions | |
DrunkenBishop () | |
Default ctor: empty board (1x1) | |
DrunkenBishop (const std::string &data_r, const std::string &title_r=std::string()) | |
Ctor taking a data string (and optional title) and using a default (SSH/GPG) board. | |
DrunkenBishop (const std::string &data_r, const std::string &title_r, unsigned height_r) | |
Ctor also taking a desired board height (even value is incremented, width is 2*height-1). | |
DrunkenBishop (const std::string &data_r, unsigned height_r) | |
DrunkenBishop (const std::string &data_r, const std::string &title_r, unsigned height_r, unsigned width_r) | |
Ctor also taking a desired board height and width (even values are incremented). | |
DrunkenBishop (const std::string &data_r, unsigned height_r, unsigned width_r) | |
~DrunkenBishop () | |
Dtor. | |
ZYPP_DECLARE_FLAGS (Options, OptionBits) | |
std::ostream & | dumpOn (std::ostream &str, Options options_r=Options()) const |
Render board to steam. | |
std::ostream & | dumpOn (std::ostream &str, const std::string &prefix_r, Options options_r=Options()) const |
std::string | asString (Options options_r=Options()) const |
Render board as string. | |
std::string | asString (const std::string &prefix_r, Options options_r=Options()) const |
std::vector< std::string > | asLines (Options options_r=Options()) const |
Render to an array of lines. | |
std::vector< std::string > | asLines (const std::string &prefix_r, Options options_r=Options()) const |
Private Attributes | |
RW_pointer< Impl > | _pimpl |
Implementation class. | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const DrunkenBishop &obj) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const DrunkenBishop &obj) |
Stream output. | |
Random art fingerprint visualization Visualize fingerprint data on a [17x9] (SSH) or [19x11] (GPG) or custom sized board.
The default board size and layout depends on the data string length (above 32 the GPG board and layout is used).
The data string should be an even sized HEX string, otherwise it will be 0-padded.
All ctor calls may throw std::invalid_argument.
Based on https://github.com/atoponce/keyart, the development location for the Debian signing-party package. We try to use the same charset and heatmap. See also http://dirk-loss.de/sshvis/drunken_bishop.pdf.
Definition at line 61 of file DrunkenBishop.h.
Enumerator | |
---|---|
USE_COLOR | use colors |
Definition at line 91 of file DrunkenBishop.h.
zypp::base::DrunkenBishop::DrunkenBishop | ( | ) |
Default ctor: empty board (1x1)
Definition at line 370 of file DrunkenBishop.cc.
zypp::base::DrunkenBishop::DrunkenBishop | ( | const std::string & | data_r, |
const std::string & | title_r = std::string() |
||
) |
Ctor taking a data string (and optional title) and using a default (SSH/GPG) board.
Definition at line 374 of file DrunkenBishop.cc.
zypp::base::DrunkenBishop::DrunkenBishop | ( | const std::string & | data_r, |
const std::string & | title_r, | ||
unsigned | height_r | ||
) |
Ctor also taking a desired board height (even value is incremented, width is 2*height-1).
Definition at line 378 of file DrunkenBishop.cc.
|
inline |
Definition at line 75 of file DrunkenBishop.h.
zypp::base::DrunkenBishop::DrunkenBishop | ( | const std::string & | data_r, |
const std::string & | title_r, | ||
unsigned | height_r, | ||
unsigned | width_r | ||
) |
Ctor also taking a desired board height and width (even values are incremented).
Definition at line 382 of file DrunkenBishop.cc.
|
inline |
Definition at line 82 of file DrunkenBishop.h.
zypp::base::DrunkenBishop::~DrunkenBishop | ( | ) |
Dtor.
Definition at line 386 of file DrunkenBishop.cc.
zypp::base::DrunkenBishop::ZYPP_DECLARE_FLAGS | ( | Options | , |
OptionBits | |||
) |
|
inline |
Render board to steam.
Definition at line 97 of file DrunkenBishop.h.
std::ostream & zypp::base::DrunkenBishop::dumpOn | ( | std::ostream & | str, |
const std::string & | prefix_r, | ||
Options | options_r = Options() |
||
) | const |
Definition at line 389 of file DrunkenBishop.cc.
|
inline |
Render board as string.
Definition at line 103 of file DrunkenBishop.h.
std::string zypp::base::DrunkenBishop::asString | ( | const std::string & | prefix_r, |
Options | options_r = Options() |
||
) | const |
Definition at line 392 of file DrunkenBishop.cc.
|
inline |
Render to an array of lines.
Definition at line 109 of file DrunkenBishop.h.
std::vector< std::string > zypp::base::DrunkenBishop::asLines | ( | const std::string & | prefix_r, |
Options | options_r = Options() |
||
) | const |
Definition at line 399 of file DrunkenBishop.cc.
|
friend |
|
related |
Stream output.
Definition at line 123 of file DrunkenBishop.h.
|
private |