Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🔢 Binary

A tiny Java CLI that converts text to binary and binary back to text.

What is Binary?

Binary converts text into 8-bit binary.

Give it some text, and it turns each character into a sequence of 0s and 1s.

Give it binary, and it turns it back into text.

Text.

Binary.

Text again.

That's it.

No dependencies. No UI. Just bytes.

Example

Convert text:

$ java -cp target/classes io.javalabs.Main hello

01101000 01100101 01101100 01101100 01101111

Run it the other way:

$ java -cp target/classes io.javalabs.Main "01101000 01100101 01101100 01101100 01101111"

hello

And maybe:

$ java -cp target/classes io.javalabs.Main Java

01001010 01100001 01110110 01100001

Binary goes in.

Text comes out.

Or text goes in.

Binary comes out.

How It Works

  1. Run Binary with some text or binary.
  2. Binary checks the input.
  3. Text is converted into 8-bit binary.
  4. Binary is converted back into characters.
  5. That's the whole thing. 🔢

Tech Stack

  • Java 21
  • String
  • Integer
  • CLI

Run

Compile:

mvn clean compile

Convert text to binary:

java -cp target/classes io.javalabs.Main hello

Convert binary to text:

java -cp target/classes io.javalabs.Main "01101000 01100101 01101100 01101100 01101111"

Why I Built This

Binary is one of those simple ideas that sits underneath almost everything we use.

This is a tiny experiment for turning characters into bits and back again.

Write some text.

Turn it into binary.

Turn it back. 🔢

JavaLabs.io

Part of JavaLabs.io - a collection of small Java experiments built to turn random ideas into working code.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages