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

@fe-cookie/server-request-crypto

v1.0.0

Published

### 使用场景

Downloads

3

Readme

server-request-crypto

使用场景

    1. 客户端与 BFF 之间进行接口加密校验
    1. BFF 与第三方语言加密校验 (例如:php 接口)
### 加密规则
  1. 获取 GET,POST 请求的请求体参数,转换为 JSON 格式。
  2. 请求体中附加时间戳参数,参数字段为_,值为时间戳。(备注:时间戳优先取请求体中的_字段,若没有则取 header头中的 x-timestamp字段)。
  3. 对转换后的请求体 JSON 进行排序,(此处参考排序规则)。
  4. 对排序好的 JSON 进行字符串拼接,(此处参考拼接规则) 。
  5. 拼接好的字符串(通过key=val&)最后再附加上固定盐值得到最后需要加密的字符串(即...&key=val&salt)。
  6. 使用MD5的方式加密最后拼接的字符串,得到加密密钥。

取值标识

  1. 通过Header头 autho-token\|x-autho-token\|external-token 获取需要匹配的加密字段。 <br >
  2. 通过Header头 autho-pass\|x-autho-pass 来觉得是否需要进行加密校验(备注:此字段通常应用于测试,方便于接口测试)。 <br >
  3. 优先通过请求体的_字段获得时间戳,其次通过 Header头 x-timestamp 获得时间字段。