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

npm-decode

v1.4.2

Published

Easily encode and decode strings using popular encrypting methods

Downloads

32

Readme

Decode

Easily encode and decode strings using popular encrypting methods

npm i @anay69420/npm-decode

Usage

import { decode } from 'decode'

console.log(decode.caeser.encode('Hello', 3)) // Khoor

Tree Shakable!!!

import { caeser, base64 } from 'decode'
// Still Works!

Ciphers

import { caeser } from 'decode'
caeser.encode('hello', 3) // khoor
caeser.decode('khoor', 3) // hello
import { base64 } from 'decode'
base64.encode('hello') // aGVsbG8=
base64.decode('aGVsbG8=') // hello
import { morse } from 'decode'
morse.encode('hello') // .... . .-.. .-.. ---
morse.decode('.... . .-.. .-.. ---') // hello
import { charCode } from 'decode'
charCode.encode('hello') // 104 101 108 108 111
charCode.decode('104 101 108 108 111') // hello
// You may optionally pass a string as a delimiter
charCode.encode('hello', '/') // 104/101/108/108/111
charCode.decode('104/101/108/111', '/') // hello
import { bacon } from 'decode'
bacon.encode('hello') // AABBB AABAA ABABA ABABA ABBAB
bacon.decode('AABBB AABAA ABABA ABABA ABBAB') // hello
// You may optionally pass an object containing values for character a and b
bacon.encode('hello', { a: '-', b: '/' }) // --/// --/-- -/-/- -/-/- -//-/
bacon.decode('--/// --/-- -/-/- -/-/- -//-/', '/', { a: '-', b: '/' }) // hello
import { affine } from 'decode'
affine.encode('hello', [5 /*a*/, 8 /*b*/]) // rclla
bacon.decode('rclla', [5, 8]) // hello
// Note that a must be coprime to 26
import { railFence } from 'decode'
railFence.encode('hello', [2, 0]) // hloel
railFence.decode('hloel', [2, 0] // hello
hash.create('hello') // 9b71d224bd62f3785d96d46ad3ea...
// By default it uses SHA-256 algorithm with output as hexadecimal.
// You can provide options to change this.
hash.create('hello', ['sha512', 'base64']) // m3HSJL1i83hdltRq0+o9czGb+8KJ...
hmac.create(['hello' /*string*/, 'abc 123' /*key*/]) //08b81922163891559333fa6b30e2...
// By default it uses SHA-256 algorithm with output as hexadecimal.
// You can provide options to change this.
hmac.create(['hello', 'abc 123'], ['sha512', 'base64']) // +ndU5Yc30cV9pg+fRFUZGay/Nuum==...
import { vignere } from 'decode'
vignere.encode('hello', 'world') // dscwr
vignere.decode('dscwr', 'world' // hello

Changelog

  • v1.4.0

    • Add vignere cipher
  • v1.3.0

    • Add hashing function
    • Add HMAC function
  • v1.2.0

    • Add Rail Fence Cipher
  • v1.1.0

    • Add Affine cipher
    • Make Unknown characters and Uppercase characters work