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

mod-crypto

v1.0.3

Published

aes minisize 128 256 512 web crypto

Downloads

18

Readme

mod-crypto

JavaScript library of aes crypto standards. runing in browser and server width mini size.

Node.js (install)

Requirements: Node.js npm

npm install --save mod-crypto

Usage

ES6 import for typical API call signing use case :

import ModCrypto from "mod-crypto"

/* enCrypto & deCrypto String with CryptoKey
*  CryptoKey expect String 16length,only number or letter characters
*  if you typing wrong value of CryptoKey ,crypto won't be working
*/
let AC1=new ModCrypto('SDRd!@#Areqd1234');
var beforStr = AC1.enCryptoStr("hello world!");
var afterStr = AC1.deCryptoStr(beforStr)
console.log(beforStr,afterStr);// "hello world!","hello world!"

// enCrypto & deCrypto String without CryptoKey
let AC2=new ModCrypto();// console.warn wrong key
var beforStr2 = AC2.enCryptoStr("hello world!"); //crypto won't be working
var afterStr2 = AC2.deCryptoStr(beforStr2)
console.log(beforStr2,afterStr2);// "hello world!","hello world!"

// enCrypto & deCrypto Object with CryptoKey
let AC3=new ModCrypto('SDRd!@#Areqd1234');
var beforStr3 = AC3.enCryptoDataToStr({name:"mod"});
var afterStr3 = AC3.deCryptoStrToData(beforStr3)
console.log(beforStr3,afterStr3);

API

new ModCrypto(CryptoKey);
CryptoKey :

expect String 16 length,only English number or letter characters. if setup with wrong value, crypto will not working!


[instance].enCryptoStr(string);
string :

enCrypto String message


[instance].dnCryptoStr(CryptedString);
CryptedString :

dnCrypto CryptedString message


[instance].enCryptoDataToStr(string);
string :

enCrypto [Object Array Boolean] message ,return CryptedString


[instance].deCryptoStrToData(CryptedString);
CryptedString :

input CryptedString return dnCrypto [Object Array Boolean] message but if message can't deCrypto as [Object Array Boolean] return null

import ModCrypto from "mod-crypto"

let AC3=new ModCrypto('SDRd!@#Areqd1234');
var beforStr3 = AC3.enCryptoDataToStr({name:"mod"});
var afterStr3 = AC3.deCryptoStrToData(beforStr3)

console.log(beforStr3,afterStr3); // 6552505ff6965eeee2e9e0dd3342 , {name:"mod"}

var beforStr4 = AC3.enCryptoDataToStr("hello world!");
var afterStr4 = AC3.deCryptoStrToData(beforStr3)

console.log(beforStr4,afterStr4); // 3c185b52f79c5ca3aff6e3dd301d , null