dtool 0.6.0

A command-line tool collection to assist development
dtool-0.6.0 is not a library.

dtool

Build Status Crates.io

dtool is a command-line tool collection to assist development

Table of Contents

Description

Now dtool supports:

  • Hex / UTF-8 string conversion
  • Hex / binary conversion
  • Timestamp / date conversion
  • Number 2/8/10/16 base conversion
  • Hex / base58 conversion
  • Hex / base58check conversion
  • Hex / base64 conversion
  • URL encode / decode
  • Number codec
  • Hash (MD5, SHA-1, SHA-2, SHA-3, RIPEMD, CRC, Blake2b)
  • UTF-8 string / unicode conversion
  • HTML entity encode / decode
  • Regex match
  • Pbkdf2
  • Case conversion (upper, lower, title, camel, pascal, snake, shouty snake, kebab)
  • AES encrypt / decrypt

Usage

dtool does different works by different sub commands:

Sub command Desc Example Remark Since
h2s Convert hex to UTF-8 string $ dtool h2s 0x61626364abcd v0.1.0
s2h Convert UTF-8 string to hex $ dtool s2h abcd0x61626364 v0.1.0
... ... ... ...

View full usage document

  • Besides the sub command help, dtool provides a new sub command usage to show examples:
$ dtool usage
Usage

----------------------------------------------------------------------------------
 Sub command  Desc                         Example                 Remark  Since 
==================================================================================
 h2s          Convert hex to UTF-8 string  $ dtool h2s 0x61626364          v0.1.0 
                                           abcd                             
----------------------------------------------------------------------------------
...
  • You can search usage with a keyword:
$ dtool usage -s md5
------------------------------------------------------------------------------
 Sub command  Desc         Example                             Remark  Since 
==============================================================================
 hash         Hex to hash  $ dtool hash -a md5 0x616263        MD5     v0.2.0 
                           0x900150983cd24fb0d6963f7d28e17f72           
------------------------------------------------------------------------------

Tips

pipe

convert a string to base64

$ echo -n abc | dtool s2h | dtool h2b64
YWJj

convert a encoded timestamp to date

$ echo -n 2c28e75d | dtool nd -tu32 | dtool ts2d
2019-12-04 11:29:48

convert a jpeg to base64

$ cat pic.jpg | dtool b2h | dtool h2b64
/9j/4AAQSkZJR...

calculate file md5

$ cat pic.jpg | dtool b2h | dtool hash -a md5
0x1884b72e23b0c93320bac6b050478ff4

Installation

Via brew

$ brew install guoxbin/guoxbin/dtool

Recommend! Brew will install dtool bash completion along with dtool

Via cargo

$ cargo install dtool