Skip to content

Eth-blockies-rs (v1.1.0)

Latest
Compare
Choose a tag to compare
@snoopy3476 snoopy3476 released this 02 Jul 12:08
· 3 commits to master since this release
ed50e26

Library Release Notes

New Features

New Cargo Features

  • compressed_png (Enabled by default)
    • Enables png compression related functions
    • Requires an external dependency deflate
      • Disable this feature if you don't need png compression

Changes (from v1.0.0 -> to v1.1.0)

  • Note: All traits and functions of v1.0.0 below still exist and also compilable on v1.1.0, but marked as deprecated
  • Renamed traits (+ member functions)
    • SeedString -> SeedInput (Integrated into the existing trait)
      • canonicalize_ethaddr() -> to_ethaddr_seed() (* Return type changed)
  • Renamed functions
    • eth_blockies_data(...) -> EthBlockies::data(...)
    • eth_blockies_data_mapped(...) -> EthBlockies::data_mapped(...)
    • eth_blockies_indexed_data(...) -> EthBlockies::indexed_data(...)
    • eth_blockies_indexed_data_mapped(...) -> EthBlockies::indexed_data_mapped(...)
    • eth_blockies_ansiseq_data(...) -> EthBlockies::ansiseq_data(...)
    • eth_blockies_png_data(...) -> EthBlockies::png_data(...) or EthBlockies::compressed_png_data(...)
    • eth_blockies_png_data_base64(...) -> EthBlockies::png_data_base64(...) or EthBlockies::compressed_png_data_base64(...)

Binary Usage

Executable binary running functions in the library.

  • Note: To print ANSI sequence colors to console properly in Windows (x86_64-pc-windows-msvc.zip), you might need to either:
    • Enable ANSI sequence support for default Windows console, or
    • Use Windows Terminal instead of the default console.
usage: eth-blockies <seed> [output-fmt (ansi|image)] [OPTIONS...]

<seed>                 Seed to generate blockies (e.g. Ethereum wallet address)

[output-fmt]  - ansi   (Default) Generate ansi sequence of blockies,
                       usually for printing to terminal
              - image  Generate png image data of blockies

[OPTIONS...]:

        -e --ethseed   Interpret seed string as Ethereum address,
                       and canonicalize seed (to lowercase + set '0x' prefix)
                       to get Ethereum blockies correctly
        -a --ascii     (only for 'ansi' mode)   Get non-compact, big blockies
                                                with ascii (non-unicode)
        -r --raw       (only for 'image' mode)  Get uncompressed, raw png image

        -s --size=<BLOCKIES_SIZE>
                       Blockies size: # of elems per side (1-32) (Default: '8')

        -d --dimension=<WIDTH>x<HEIGHT>
                       Dimensions of output in the form of '(width)x(height)'
                       If not given, following is used (Default):
                       - ('ansi' mode)   '(blockies_size)x(blockies_size)'
                       - ('image' mode)  '128x128'

        -o --outfile=<FILENAME>
                       File name to write output
                       If the parameter is not given, stdout is used (Default)



examples:

- Outputs from following commands are all the same:
$ eth-blockies 0xe686c14ff9c11038f2b1c9ad617f2346cfb817dc
$ eth-blockies e686c14FF9C11038F2B1c9aD617F2346CFB817dC -e

- Outputs from following commands are all the same:
$ eth-blockies "generic_seed_not_ethaddr" --size=15
$ eth-blockies "generic_seed_not_ethaddr" ansi --size=15 --dimension=15x15
$ eth-blockies "generic_seed_not_ethaddr" a -s 15 -d 15x15

- Outputs from following commands are all the same:
$ eth-blockies "generic_seed" image > blockies.png
$ eth-blockies "generic_seed" i -d128x128 -oblockies.png
$ eth-blockies "generic_seed" i -d 128x128 -o blockies.png