dtool 0.1.0

A collection of development tools
dtool-0.1.0 is not a library.

dtool

Build Status

dtool is a collection of development tools:

Sub command Description Examples
h2s Convert hex to string $ dtool h2s 0x61626364 abcd
s2h Convert string to hex $ dtool h2s abcd 0x61626364
ts2d Convert timestamp to date $ dtool ts2d 10000 1970-01-01 10:46:40 $ dtool ts2d -z0 10000 1970-01-01 02:46:40
d2ts Convert date to timestamp $ dtool d2ts '1970-01-01 10:46:40' 10000 $ dtool d2ts -z0 '1970-01-01 02:46:40' 10000
d2ts Number system $ dtool ns 256 256 0b100000000 0o400 0x100
h2b58 Convert hex to base58 $ dtool h2b58 0x0075774f5d9963c021009a58d7d2d8e83771dd6c7a 12dvBhvPEPniQmBmgvj4qpJEodT7P
h2b58c Convert hex to base58 check $ dtool h2b58c 0x0075774f5d9963c021009a58d7d2d8e83771dd6c7a 1Bi6zFVNtntP5MtDraNrAD7e469ifsQMwF
b582h Convert base58 to hex $ dtool b582h 12dvBhvPEPniQmBmgvj4qpJEodT7P 0x0075774f5d9963c021009a58d7d2d8e83771dd6c7a
b58c2h Convert base58 check to hex $ dtool b58c2h 1Bi6zFVNtntP5MtDraNrAD7e469ifsQMwF 0x0075774f5d9963c021009a58d7d2d8e83771dd6c7a
h2b64 Convert hex to base64 $ dtool h2b64 0x616263 YWJj
b642h Convert base64 to hex $ dtool b642h YWJj 0x616263
ue URL encode $ dtool ue a+b a%2Bb
ud URL decode $ dtool ue a%2Bb a+b
ne Number encode $ dtool ne -tu8 1 0x01 $ dtool ne -tu16 1 0x0100 $ dtool ne -tu32 1 0x01000000 $ dtool ne -tu64 1 0x0100000000000000 $ dtool ne -tu128 1 0x01000000000000000000000000000000 $ dtool ne -tc 6 0x18 dtool ne -tc 251 0xed03
nd Number decode $ dtool nd -tu8 0x01 1 $ dtool nd -tu16 0x0100 1 $ dtool nd -tu32 0x01000000 1 $ dtool nd -tu64 0x0100000000000000 1 $ dtool nd -tu128 0x01000000000000000000000000000000 1 $ dtool nd -tc 0x18 6 $ dtool nd -tc 0xed03 251

Tips

pipe

you can convert a string to base64 by a pipe

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

you can convert a encoded timestamp to date

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

Installation

Via cargo

$ cargo install dtool

Via homebrew

$ brew install dtool