npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

amtixdev-binarycode

v1.0.0-beta

Published

is a versatile npm package that provides functionalities for encoding text to binary, decoding binary to text, fetching binary data from URLs, and basic text encryption/decryption.

Downloads

5

Readme

Amtixdev-Binarycode

'amtixdev-binarycode' is a versatile npm package that provides functionalities for encoding text to binary, decoding binary to text, fetching binary data from URLs, and basic text encryption/decryption.

Installation

You can install the 'amtixdev-binarycode' package using npm:

npm install amtixdev-binarycode

Usage

Text to Binary Convert a string of text to binary representation:

const binarycode = require('amtixdev-binarycode');

const text = 'The quick brown 🦊 jumps over 13 lazy 🐶.';
const binary = binarycode.textToBinary(text);

console.log(binary);
// Output: 01010100 01101000 01100101 00100000 01110001 01110101 01101001 01100011 01101011 00100000 01100010 01110010 01101111 01110111 01101110 00100000 11110000 10011111 10100110 10001010 00100000 01101010 01110101 01101101 01110000 01110011 00100000 01101111 01110110 01100101 01110...

const decodedText = binarycode.binaryToText(binary);
console.log(decodedText);
// Output: The quick brown 🦊 jumps over 13 lazy 🐶.

Fetch Binary Data from URL Fetch binary data from a specified URL:

const binarycode = require('amtixdev-binarycode');

const url = 'https://example.com/binary-data';
binarycode.fetchBinaryData(url).then(binaryData => {
  console.log(binaryData);
});

Text Encryption and Decryption Encrypt and decrypt sensitive information using a secret key:

const binarycode = require('amtixdev-binarycode');

const text = 'Sensitive information';
const secretKey = 'mySecretKey';

const encryptedText = binarycode.encryptText(text, secretKey);
console.log(encryptedText);

const decryptedText = binarycode.decryptText(encryptedText, secretKey);
console.log(decryptedText);

Discord Bot Example

Integrating amtixdev-binarycode in a Discord bot:

const Discord = require('discord.js');
const binarycode = require('amtixdev-binarycode');

const client = new Discord.Client();
const token = 'YOUR_DISCORD_BOT_TOKEN';

client.on('message', async message => {
  if (message.content.startsWith('!binary')) {
    const textToEncode = message.content.slice('!binary'.length).trim();
    
    // Convert text to binary
    const binaryRepresentation = binarycode.textToBinary(textToEncode);

    // Send the binary representation as a reply
    message.reply(`Binary representation: \`${binaryRepresentation}\``);
  }

  if (message.content.startsWith('!decode')) {
    const binaryToDecode = message.content.slice('!decode'.length).trim();

    // Convert binary to text
    const decodedText = binarycode.binaryToText(binaryToDecode);

    // Send the decoded text as a reply
    message.reply(`Decoded text: \`${decodedText}\``);
  }
});

client.login(token);

Make sure to replace 'YOUR_DISCORD_BOT_TOKEN' with your actual Discord bot token. This example listens for messages starting with !binary and !decode, encoding and decoding text accordingly and replying with the results.