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

mobile-sign

v1.0.2

Published

A project to solve the problem of mobile terminal signature verification.

Downloads

11

Readme

mobile-sign

A project to solve the problem of mobile api request signature verification.

features

  • multi language back-end demos
  • more secret sign maker.

usage

First, install mobile-sign

npm install mobile-sign

Second, require it and calc the sign by key and secret.

let sign = require('mobile-sign')
const token = sign.calcFormDataSign('your key', 'your secret', FormData, ''); // if you want to make a request by FormData
const token = sign.calcJsonSign('your key', 'your secret', json, ''); // or you can upload a json

Finally, send this token to your api server, your server can check it by the same algorithm.

sign algorithm

You can enjoy it on CodePen

https://codepen.io/jeffrey-lunaon/full/oNjQYww

Every APP will apply a key and secret for sign Hash Encryption, client should make secret key as secure as possible.

Every request, you should use key+sorted POST fields + soreted fields map to values + secret to generate a string with utf8, and use the md5 to hash the sign, and request to back-end with your key(GET params or HTTP-Header).

The data of File, we upload the file md5 for check

http request demo

POST /?key=6g5lE&sign=ad197a1657d9d2576469a5d5ad6e57ff HTTP/1.1
Host: www.badidu.com
Connection: keep-alive
Content-Length: 9053
Pragma: no-cache
X-token: 6g5lE&user_id&file&size_x&size_y&user_id&a88151ef1c53b2892cdde490774c6625&100&200&uid123&TnK2w&TnK2w
Cache-Control: no-cache
DNT: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryg3TqD40tuUsq4mTx
Accept: */*
Origin: chrome-extension://coohjcphdfgbiolnekdpbcijmhambjff
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7

------WebKitFormBoundaryg3TqD40tuUsq4mTx
Content-Disposition: form-data; name="user_id"

uid123
------WebKitFormBoundaryg3TqD40tuUsq4mTx
Content-Disposition: form-data; name="size_x"

100
------WebKitFormBoundaryg3TqD40tuUsq4mTx
Content-Disposition: form-data; name="size_y"

200
------WebKitFormBoundaryg3TqD40tuUsq4mTx
Content-Disposition: form-data; name="file"; filename="51.jpg"
Content-Type: image/jpeg


------WebKitFormBoundaryg3TqD40tuUsq4mTx--