New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@confuzzle/ecoji-buffers

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@confuzzle/ecoji-buffers

Encode and decode arbitrary data as emoji

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@confuzzle/ecoji-buffers

Encode and decode arbitrary data as emoji. Since it uses ecoji-js under the hood it may be compatible with the ecoji standard, but has not been tested for this.

Huge thanks are owed to the following authors whose work is used in this package under license:

This package differs from the packages above in that it operates with buffers. ecoji-js only accepts and produces strings, so is less convenient for arbitrary binary data. emojicoding accepts only arrays of emoji to decode, meaning strings need to be split into emoji (non-trivial). See grapheme-splitter for a possible way to do this.

ecoji-buffers also differs from these packages in that it is a standalone package with no dependencies.

Functions

  • encode(x) - encodes a Uint8Array or Buffer as an emoji string
  • decode(x) - decodes an emoji string to a Buffer

Example Usage

const ecoji = require('@confuzzle/ecoji-buffers');
const x = Buffer.from('Hello world');
const y = ecoji.encode(x);
console.log(y); // 🏯🔩🚗🌷🍉🤣🦒🕊👡
const z = ecoji.decode(y).toString();
console.log(z); // Hello world

Limitations

This package has not been optimised for performance in any way, and has not been extensively tested. Use at your own risk.

Keywords

FAQs

Package last updated on 08 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc