semvec/pypi-packages huggingface dataset:
encutil 0.1.0
Encoding/Decoding Utility CLI - base64, hex, URL, HTML, hashing, JWT decoding
License: MIT
Requires Python: >=3.8
Keywords: cli, encoding, decoding, base64, hex, hash, jwt, url

# encutil

Encoding/Decoding Utility CLI - encode and decode base64, hex, URL, HTML entities, hash strings/files, and decode JWTs.

## Installation

```bash
pip install encutil
```

## Usage

All commands accept input as an argument, from `-f FILE`, or from stdin.

### Base64

```bash
encutil b64e "hello world"           # SGVsbG8gV29ybGQ=
encutil b64d "SGVsbG8gV29ybGQ="       # hello world
echo "secret" | encutil b64e         # c2VjcmV0Cg==
```

### Hex

```bash
encutil hex "hello"                  # 68656c6c6f
encutil unhex "68656c6c6f"           # hello
```

### URL Encoding

```bash
encutil url "hello world"            # hello%20world
encutil unurl "hello%20world"        # hello world
encutil url "key=value&foo=bar"      # key%3Dvalue%26foo%3Dbar
```

### HTML Entities

```bash
encutil html "<script>alert('xss')</script>"
# &lt;script&gt;alert(&#x27;xss&#x27;)&lt;/script&gt;

encutil unhtml "&lt;script&gt;"      # <script>
```

### Hashing

```bash
encutil hash sha256 "password"       # 5e884898da28...
encutil hash md5 "text"              # 1cb251ec0d56...
encutil hashfile sha256 myfile.txt   # Hash a file
```

Supported algorithms: `md5`, `sha1`, `sha256`, `sha512`, `sha224`, `sha384`

### JWT Decoding

Decode JWT tokens without verification (extracts header and payload):

```bash
encutil jwt "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"

# Header:
# {
#   "alg": "HS256",
#   "typ": "JWT"
# }
#
# Payload:
# {
#   "sub": "1234567890",
#   "name": "John Doe",
#   "iat": 1516239022
# }
```

### Auto-Detect Encoding

Try multiple decodings and show what works:

```bash
encutil detect "SGVsbG8gV29ybGQ="

# BASE64:
# Hello World
```

### JSON Output

All commands support `--json` for machine-readable output:

```bash
encutil b64e "hello" --json          # {"base64": "aGVsbG8="}
encutil hash sha256 "test" --json    # {"algorithm": "sha256", "hash": "9f86d08..."}
```

### File Input

Read from file with `-f`:

```bash
encutil b64e -f secret.txt
encutil hashfile sha256 myfile.bin
```

## For AI Agents

See [SKILL.md](SKILL.md) for AI-agent-friendly documentation.

## License

MIT