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 🙏

© 2026 – Pkg Stats / Ryan Hefner

asai-vue-aes

v0.2.1

Published

asai for you

Readme

asai-vue-aes — AES-GCM 加密/解密模块

包信息

| 建议 npm 名 | 入口文件 | $fn / 注入键 | 类型 | |------------|---------|-------------|------| | @estun/asai-vue-aes | src/index.ts | AsaiVueAES{ useAES } | Feature |

概述

asai-vue-aes 提供 AES-GCM 加解密,优先使用 Web Crypto API(HTTPS),不支持时降级到 @noble/ciphers 纯 JS 实现。

集成方式

// monorepo — webclient/src/App.vue(首屏同步)
import AsaiVueAES from './plugs/asai-vue-aes/src/index';
// npm
// import { useAES } from '@estun/asai-vue-aes';

useProvide({ plugs: { AsaiVueAES } });
const aes = ujt.$fn.AsaiVueAES.useAES(ujt);

独立性约束

  • 禁止 cross-import 其它 plugs/*
  • 密钥与算法自 $global.sys.aes 读取,不依赖其它 Feature 插件。

主要 API / 导出

| 方法 | 说明 | |------|------| | useAES(ujt) | 工厂,返回 { encrypt, decrypt, toAES, fromAES } | | encrypt(plaintext) | 低级加密 → EncryptoData | | decrypt(encrypted) | 低级解密 | | toAES(data) | 高级加密(自动识别 string/object) | | fromAES(aesData) | 高级解密 |

EncryptoData: { data, iv, auth, aes?: 1|2 }(Base64URL)

性能说明

  • 首屏同步注册;@noble/ciphers 在构建时打入包,HTTP 降级场景约 +50KB。
  • 密钥与 CryptoKey 实例缓存,避免重复 importKey。
  • 可考虑对 noble 路径使用动态 import() 进一步优化(当前同步打包)。

peerDependencies 建议

{
  "peerDependencies": {
    "vue": "^3.4.0"
  },
  "dependencies": {
    "@noble/ciphers": "^1.0.0"
  }
}

配置 $global.sys.aes

| 参数 | 说明 | |------|------| | keybase64 | Base64 密钥 | | algorithm | 'AES-GCM' | | keylength | 128 / 192 / 256 | | ivlength | 推荐 12 | | aad | 附加认证数据 |

使用示例

const encrypted = await aes.toAES({ userId: 123 });
const plain = await aes.fromAES(encrypted);

文件结构

asai-vue-aes/
├── src/index.ts
└── src/components/useAES.ts

注意事项

  • 高级接口失败时返回原始数据并 console.error,不抛异常。
  • toAES 输出 aes: 1(字符串)或 aes: 2(JSON 对象)。