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

crypto-utils-js

v1.2.0

Published

JavaScript library for encryption / decryption.

Downloads

12

Readme

crypto-utils-js

JavaScript library for encryption / decryption.

This package is intended to work both on the server side and on the client side.

Installation:

$ npm install --save crypto-utils-js

Documentation:

ROT-X

/* 
*   RotX is a simple letter substitution cipher 
*   that replaces a letter with the X letter 
*   after it in the alphabet. ROT-X is a special 
*   case of the Caesar cipher
*
*   A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
*   N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
*/

Usage on typescript:

// Import the package:
import { rotx } from 'crypto-utils-js';

// Use it:
let encrypt: string = rotx("plain string", 13);
let decrypt: string = rotx("rot-13 string", 13);

// Definition of rotx method:
// rotx(str: string, base: number): string

Usage on javascript:

// Import the package:
const crypto = require('crypto-utils-js');

// Use it:
let encrypt = crypto.rotx("plain string", 13);
let decrypt = crypto.rotx("rot-13 string", 13);

// Definition of rotx method:
// rotx(str: string, base: number): string

Base64

/* 
*   Base64 is a group of binary-to-text encoding 
*   schemes that represent binary data 
*   (more specifically, a sequence of 8-bit bytes) 
*   in sequences of 24 bits that can be represented 
*   by four 6-bit Base64 digits.
*
*   The more data, the larger hash!
*   VGhlIG1vcmUgZGF0YSwgdGhlIGxhcmdlciBoYXNoIQ==
*/

Usage on typescript:

// Import the package:
import { base64 } from 'crypto-utils-js';

// Use it:
let encrypt: string = base64.encode("plain string");
let decrypt: string = base64.decode("base64 string");

// Definition of base64 methods:
// base64.encode(str: string): string
// base64.decode(str: string): string

Usage on javascript:

// Import the package:
const crypto = require('crypto-utils-js');

// Use it:
let encrypt = crypto.base64.encode("plain string");
let decrypt = crypto.base64.decode("base64 string");

// Definition of base64 methods:
// base64.encode(str: string): string
// base64.decode(str: string): string

Hex

/* 
*   Hex
*   Hexadecimal is the name of the numbering 
*   system that is base 16. This system, 
*   therefore, has numerals 0 - 15.
*
*   That means that two-digit decimal numbers 
*   10 - 15 must be represented by a single 
*   numeral to exist in this numbering system.
*   "A"–"F" respectively.
*
*   0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*   0 1 2 3 4 5 6 7 8 9 A  B  C  D  E  F
*/

Usage on typescript:

// Import the package:
import { hex } from 'crypto-utils-js';

// Use it:
let encrypt: string = hex.encode("plain string");
let decrypt: string = hex.decode("hexadecimal string");

// Definition of hex methods:
// hex.encode(str: string): string
// hex.decode(str: string): string

Usage on javascript:

// Import the package:
const crypto = require('crypto-utils-js');

// Use it:
let encrypt = crypto.hex.encode("plain string");
let decrypt = crypto.hex.decode("hexadecimal string");

// Definition of hex methods:
// hex.encode(str: string): string
// hex.decode(str: string): string