Giter Club home page Giter Club logo

basemeow's Introduction

baseMEOW

baseMEOW is an encoder/decoder that can store binary as a string of characters that spell out "meow" in some way, similar to base64.

Installation

# requires Python 3.7+
pip install baseMEOW

Usage

Encoding

$ echo 'hello' | baseMEOW
MeEeeOoWmEeooWwmmEeowwwWw

$ echo 'im a kitty' | baseMEOW
MeEeOwWMeeEEEoOOwwWWWmMmeOoOwMEooWMeeOWwMMMmM

$ dd if=/dev/urandom bs=1 count=30 | baseMEOW
30+0 records in
30+0 records out
30 bytes transferred in 0.000061 secs (491520 bytes/sec)
MMmeEOOowMEOWMMmEOowMEeEeEOWwwmeOOOooWmMmMMMeeeowwWmMMeEEOOWWWmmEOoOowwmmeoOWMmMmeEooWMEEeoWwmeOoOoOWWwWWmeEEoOOwWmmeoOwW

Decoding

$ echo 'MeEeeOoWmEeooWwmmEeowwwWw' | baseMEOW --decode
hello
$ echo 'MeEeOwWMeeEEEoOOwwWWWmMmeOoOwMEooWMeeOWwMMMmM' | baseMEOW --decode
im a kitty
$
# non UTF-8 data is printed as hex
$ echo 'MMmeEOOowMEOWMMmEOowMEeEeEOWwwmeOOOooWmMmMMMeeeowwWmMMeEEOOWWWmmEOoOowwmmeoOWMmMmeEooWMEEeoWwmeOoOoOWWwWWmeEEoOOwWmmeoOwW' | baseMEOW --decode
2ecb7fc9edeabe3d085a810f2618cc11eaccfbeae47cb6f6ab28786193e6

Benchmarks

See benchmark.py

test case base64 runtime (ms) baseMEOW runtime (ms) base64 size (bytes) baseMEOW size (bytes)
10 characters 11.06 202.69 17 42
1000 characters 12.05 168.23 1337 4002
10000 characters 11.57 159.92 13337 40002
1000000 characters 34.74 2500.45 1333337 4000002

NASM Benchmarks

Using the assembly encoder the runtimes are much better.

# build meow.nasm
make run
test case base64 runtime (ms) baseMEOW runtime (ms) base64 size (bytes) baseMEOW size (bytes)
10 characters 3.8 2.84 17 41
1000 characters 4.24 3.02 1354 4001
10000 characters 4.26 3.76 13512 40001
1000000 characters 9.83 34.5 1350880 4000001

basemeow's People

Contributors

driazati avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.