An open API service indexing awesome lists of open source software.

https://github.com/biningo/bd

字符串和进制编码解析工具
https://github.com/biningo/bd

Last synced: 9 months ago
JSON representation

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

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 |
+----------+
```