bd

command module
v0.0.0-...-80b11e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 8 Imported by: 0

README

bd

字符串和进制编码解析工具

Installation

go install github.com/biningo/bd@latest

Features

  • 支持10进制、2进制、16进制互转
  • 支持解析UTF-8编码的字符串

Usage

bd "hello,世界" -t s
hello,世界
+------+----------------+------------------+
| CHAR |    UNICODE     |       UTF8       |
+------+----------------+------------------+
| h    | \u68 (104)     | [0x68]           |
| e    | \u65 (101)     | [0x65]           |
| l    | \u6c (108)     | [0x6c]           |
| l    | \u6c (108)     | [0x6c]           |
| o    | \u6f (111)     | [0x6f]           |
| ,    | \u2c (44)      | [0x2c]           |
| 世   | \u4e16 (19990) | [0xe4 0xb8 0x96] |
| 界   | \u754c (30028) | [0xe7 0x95 0x8c] |
+------+----------------+------------------+
bd 200
bd -t d 200
200
0xc8
11001000
+----------+
| 0xc8     |
| 11001000 |
+----------+
bd -t h 0xc8
200
0xc8
11001000
+----------+
| 0xc8     |
| 11001000 |
+----------+
bd -t b 11001000
200
0xc8
11001000
+----------+
| 0xc8     |
| 11001000 |
+----------+

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL