Crate drunkenbishop

Crate drunkenbishop 

Source
Expand description

Library implementing the “drunken bishop” algorithm, popularly used in the OpenSSH “randomart” key visualization feature.

Special thanks to the paper “The drunken bishop: An analysis of the OpenSSH fingerprint visualization algorithm” by Dirk Loss, Tobias Limmer, and Alexander von Gernler.

The board size is locked to a 17 by 9 grid, to match the OpenSSH implementation. Unlike the original implementation however, no ASCII border will be drawn around the output.

This crate includes optional features that are not enabled by default:

  • hexparse - introduces a new function that accepts a hexadecimal string, and parses it into bytes, before rendering.
  • hash - introduces a new function that accepts any arbitrary string, and hashes it with SHA-256, before rendering.

Enums§

RenderError
Errors that may arise while rendering.

Functions§

render
Render the path of the “drunken bishop” from a slice of bytes.