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

@xushuyi/crypt

v1.0.7

Published

私有加密解密模块,生产环境为定制配置。

Downloads

10

Readme

crypt

私有加解密模块,定制模块。

配置

开发环境下

  • AES 加密模式 CBC
  • 填充模式 zeropadding
  • 密钥key 1234567890123456
  • 偏移量iv 1234567890abcdef
  • 输出hex

生产环境下

  • AES 加密模式 CBC
  • 填充模式 pkcs5padding
  • 密钥key 从配置文件中读取
  • 偏移量iv 从配置文件中读取
  • 需要mac address被授权
  • 输出hex

示例

const plainText = "欢迎使用crypt加解密模块。";

console.log('当前加密环境:', crypt.env());
const cipherText = crypt.zmencrypt(plainText);
const cipherPhone = crypt.zmencrypt('13800138000');
console.log('cipherPhone=', cipherPhone);

输出结果: 30bd4f3848b25fae0218a6dcb6ca4a7c

插件提供的方法

  • env 插件的环境变量, 非process.env.NODE_ENV变量
  • md5 MD5方法
  • macaddress 获取服务器mac地址
  • indocker 判断是否在docker环境中
  • zmencrypt 加密方法 aes/cbc/zeropadding/128bit/hex
  • zmdecrypt 解密方法 aes/cbc/zeropadding/128bit/hex
  • starzmdecrypt 解密方法 手机号码星号输出
  • encrypt 加密方法 aes/cbc/pkcs5padding/128bit/hex
  • decrypt 解密方法 aes/cbc/pkcs5padding/128bit/hex
  • stardecrypt 解密方法 手机号码星号输出