Giter VIP home page Giter VIP logo

base64-emoji's Introduction

base64-emoji

Inspired by base-emoji this module allows for transformation of any binary data to and from emoji using only 64 different emojicons (+1 for padding).

emojo-all-the-things

Build status js-standard-style abstract-encoding

Installation

npm install base64-emoji

Usage

var emoji = require('base64-emoji')

var encoded = emoji.encode('Hello World')
var decoded = emoji.decode(encoded)

console.log(encoded.toString()) // => 🍕📙🕡🌵🎎📙🚢😮🕡🐗🏦🕤🎎📙🕖📫
console.log(decoded.toString()) // => Hello World

API

buffer = emoji.encode(buffer|string, [buffer], [offset])

The encode function takes a buffer or a string and returns a buffer containing the encoded bytes. The optional 2nd buffer argument will be used to store the encoded result. If not provided a new buffer will be allocated. If an offset is passed as the 3rd argument the input will be encoded into the buffer at that byte offset. The offset defauls to 0.

buffer = emoji.decode(buffer|string, [offset], [length])

The decode function takes a buffer or a string and returns a buffer containing the decoded bytes. If an offset is passed as the 2nd argumetn, the input will be decoded from that byte offset. Tye byte offset defaults to 0. A length can be passed as the 3rd argument specifying the number of bytes that should be decoded. The length defaults to the input byte length.

length = emoji.encodingLength(buffer|string)

Returns the amount of bytes needed to encode the buffer or string given as input.

License

MIT

base64-emoji's People

Contributors

watson avatar

Stargazers

Hoang Neal avatar

Watchers

Steve Smith avatar James Cloos avatar  avatar

Forkers

nealhoang

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.