https://github.com/simatwa/tobin
Convert text to binary and vice versa
https://github.com/simatwa/tobin
Last synced: about 1 year ago
JSON representation
Convert text to binary and vice versa
- Host: GitHub
- URL: https://github.com/simatwa/tobin
- Owner: Simatwa
- License: mit
- Created: 2023-06-11T09:39:17.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-11T10:19:28.000Z (about 3 years ago)
- Last Synced: 2024-12-25T11:42:05.429Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tobin
> Convert text to binary and vice versa
## Installation
1. Install [addtopath](https://github.com/Simatwa/addtopath).
2. Clone repo and install
```sh
git clone https://github.com/Simatwa/tobin.git
cd tobin
addtopath main.py tobin
```
## Usage
1. Convert ascii to binary
- `$ tobin -b "`
> Instance:
```sh
tobin -b "Hello world"
# Output : 01001000 01100101 01101100 01101100 01101111 00100000 01110111 01101111 01110010 01101100 01100100
```
2. Convert binary to ascii
- `$ tobin `
> Instance:
```sh
tobin "01001000 01100101 01101100 01101100 01101111 00100000 01110111 01101111 01110010 01101100 01100100"
# Output : Hello world
```
- For more info run:
- `$ tobin -h`
```
usage: tobin [-h] [-f FILE] [-b] [message]
Convert text to binary and vice versa
positional arguments:
message Message to be
converted
options:
-h, --help show this help message
and exit
-f FILE, --file FILE Path to file
containing message
-b, --bin Convert message to
binary
01001000 01100101 01101100 01101100 01101111
00100000 01110101 00110000 01011111 01100001
00110010 00110000 00110011 Hello u0_a203
```