Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wecom/crypto

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wecom/crypto

企业微信加解密库,详见企业微信 API 文档 [加解密方案说明](https://work.weixin.qq.com/api/doc/90001/90148/91144) 和 [JS-SDK使用权限签名算法](https://work.weixin.qq.com/api/doc/90000/90136/90506)。

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@wecom/crypto

企业微信加解密库,详见企业微信 API 文档 加解密方案说明JS-SDK使用权限签名算法

使用

# with npm
npm install @wecom/crypto
# with yarn
yarn add @wecom/crypto

API

获取消息体签名

import { getSignature } from '@wecom/crypto';

const signature = getSignature(token, timestamp, nonce, ciphered);

expect(signature).toEqual(query.signature);

解密消息

import { decrypt } from '@wecom/crypto';

const { message, id } = decrypt(encodingAESKey, ciphered);

console.log({ message, id });

加密消息

import { encrypt } from '@wecom/crypto';

const ciphered = encrypt(encodingAESKey, message, id);

console.log(ciphered);

获取 JS-SDK 签名

import { getJsApiSignature } from '@wecom/crypto'

const { timestamp, nonceStr, signature } = getJsApiSignature({ url, ticket });

console.log({ timestamp, nonceStr, signature });

FAQs

Package last updated on 04 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc