Code Monkey home page Code Monkey logo

bemoji256's Introduction

base256

Travis Coverage Status Release Go Report Card License GoDoc

πŸŒ€ Base256 is a binary-to-emoji encoding scheme implementation.

Install

$ go get -u ekyu.moe/base256
# or better
$ dep ensure -add ekyu.moe/base256

Example

package main

import (
    "fmt"

    "ekyu.moe/base256"
)

func main() {
    fmt.Println(base256.EncodeToString([]byte("Hello, δΈ–η•Œ")))   //=> πŸ‘ΎπŸ§πŸ™†πŸ¬πŸ™‡πŸŒ±πŸ˜ŒπŸšŸπŸ’¦πŸ₯πŸ΄πŸ€πŸ‘ˆ
    fmt.Println(string(base256.DecodeString("πŸ‘ΎπŸ§πŸ™†πŸ¬πŸ™‡πŸŒ±πŸ˜ŒπŸšŸπŸ’¦πŸ₯πŸ΄πŸ€πŸ‘ˆ"))) //=> Hello, δΈ–η•Œ
}

Check godoc for further documents.

A CLI utility is also available with go get ekyu.moe/base256/cmd/base256.

Specification

base256 encoding uses two tables to transform a single byte into a single emoji. The tables can be found in table.go. In this implementation, these tables are utilized circularly when encoding, however such rule does not apply to decoding.

To achieve the best compatibility, all the emojis are picked from the classic version and each of them is guaranteed to be 4 bytes long in UTF-8.

License

BSD-3-clause

bemoji256's People

Watchers

 avatar  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.