https://github.com/biningo/bd
字符串和进制编码解析工具
https://github.com/biningo/bd
Last synced: 9 months ago
JSON representation
字符串和进制编码解析工具
- Host: GitHub
- URL: https://github.com/biningo/bd
- Owner: biningo
- License: mit
- Created: 2023-08-19T10:05:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-29T08:29:48.000Z (over 2 years ago)
- Last Synced: 2025-03-25T20:05:58.864Z (10 months ago)
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## bd
字符串和进制编码解析工具
## Installation
```bash
go install github.com/biningo/bd@latest
```
## Features
- 支持10进制、2进制、16进制互转
- 支持解析UTF-8编码的字符串
## Usage
```bash
bd "hello,世界" -t s
```
```text
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] |
+------+----------------+------------------+
```
```bash
bd 200
bd -t d 200
```
```text
200
0xc8
11001000
+----------+
| 0xc8 |
| 11001000 |
+----------+
```
```bash
bd -t h 0xc8
```
```text
200
0xc8
11001000
+----------+
| 0xc8 |
| 11001000 |
+----------+
```
```bash
bd -t b 11001000
```
```text
200
0xc8
11001000
+----------+
| 0xc8 |
| 11001000 |
+----------+
```