0.0.1 ā€¢ Published 2 years ago

checkmoji v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

checkmoji

šŸ¦„ checksum but it's emoji

  • Supports a whopping 1024 different emojis
  • Configurable length of up to 26 emoji-characters (default: 26)
  • Uses blake2b for hashing under the hood

Installation

$ npm install checkmoji

Usage

import { checkmoji } from "./checkmoji";

// Example 1: Only 1 bit has changed for the input,
// but the output is very different:

// Yields "šŸ“ šŸ‡¶šŸ‡¦šŸ”µšŸŽµšŸ‡±šŸ‡®šŸŽŸļøšŸ‡§šŸ‡¾šŸ‘ŠšŸŒ„ļøšŸ‡ÆšŸ‡ŖšŸ–ŒļøšŸ‡¹šŸ‡æšŸ†ššŸŒˆšŸ‡·šŸ‡“šŸ‡²šŸ‡²šŸ‡­šŸ‡²šŸ‡ŗšŸ‡¾šŸ’…šŸļøšŸ‘©ā€šŸš’šŸ‘‰šŸ‡»šŸ‡ŖšŸ„šŸ‡ØšŸ‡¦šŸ¹"
console.log(checkmoji("a"));
// Yields "šŸ‡°šŸ‡¬šŸ•ŽšŸ“•šŸœšŸ‘£šŸ–ļøšŸ‡®šŸ‡øšŸœšŸ‡ØšŸ‡»šŸŠšŸ‘©ā€šŸ«šŸ‘Øā€šŸ«šŸ€„šŸ‡¦šŸ‡ØšŸ‡ØšŸ‡æšŸ”£šŸ‘©ā€šŸ’¼šŸ‘Øā€šŸ‘Øā€šŸ‘§šŸ“šŸ”»šŸ‘©ā€āš–ļøšŸƒā€ā™‚ļøšŸ”šŸ•¹ļøšŸŽ†šŸŽ’"
console.log(checkmoji("b"));

// Example 2: Setting the length of the checksum, will return the same checksum,
// but with a different length (like in git):

// Yields 26 characters "šŸ…¾ļøšŸ”„šŸ‡¬šŸ‡µšŸ”•šŸ—ļøšŸ­šŸ‘Øā€āœˆļøšŸ”ŖšŸ‘Øā€šŸŒ¾šŸ’šŸ’‹šŸ“žšŸ‡§šŸ‡®šŸŒœšŸ’…šŸ†—šŸ‘®šŸ…šŸ™šŸŒļøā€ā™‚ļøšŸ’¶šŸ“šŸ‡§šŸ‡ÆšŸ‡¹šŸ‡°šŸ‘Æā€ā™€ļøšŸ•‹"
console.log(checkmoji("hello, world"));
// Yields 8 characters "šŸ…¾ļøšŸ”„šŸ‡¬šŸ‡µšŸ”•šŸ—ļøšŸ­šŸ‘Øā€āœˆļøšŸ”Ŗ"
console.log(checkmoji("hello, world", 8));

Note

While the character count of two checksums are the same, the actual amount of bytes used for the characters is not guaranteed. This is because each emoji can vary in size.

0.0.1

2 years ago

0.0.1-5

2 years ago

0.0.1-4

2 years ago

0.0.1-3

2 years ago

0.0.1-2

2 years ago

0.0.1-1

2 years ago