[][src]Crate b0x

A simple CLI tool to display information about the provided input.

Installation

$ cargo install b0x

Usage

While you can't see it below, it prints everything in color.

Numbers

Supported formats:

  • Decimal: 42
  • Binary: 0b101010
  • Octal: 0o52
  • Hexadecimal: 0x2A
$ b0x 0xC0FFEE
found u128(12648430)
➔ radix
   bin 110000001111111111101110
     ├ ones 16
     ├ zeros 8 (112)
     ├ leading zeros 104
     └ trailing zeros 1
   oct 60177756
   dec 12648430
   hex c0ffee
   HEX C0FFEE
➔ prime
   prime? false
➔ misc
   perfect a^k 12648430 ^ 1
   2^k? false
   next 2^k 16777216
➔ english
   english "twelve million, six hundred and forty-eight thousand, four hundred and thirty"

Strings

$ b0x "TeSt StRiNg"
found string(TeSt StRiNg)
➔ structure
   ascii? true
➔ graphemes
   array ["T", "e", "S", "t", " ", "S", "t", "R", "i", "N", "g"]
   len 11
➔ words
   array ["TeSt", "StRiNg"]
   len 2
➔ bytes
   array [84, 101, 83, 116, 32, 83, 116, 82, 105, 78, 103]
   len 11
➔ modifications
   upper TEST STRING
   lower test string

Modules

config

Contains utilities for storing configuration

pass

Defines passes

Functions

run

Given a Config, try to parse the input stored in it as a number and print information. If the input can't be parsed as a u128, fall back to String.