1.0.8 • Published 3 years ago

hita-tool v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

hita-tool

1.crypt

生成公私钥及其加解密

   const { crypt } = require('hita-tool')
   const { publicKey, privateKey } = crypt.generator() //生成公私钥
   const res = crypt.encrypt(text, publicKey)   // 公钥加密
   const res = crypt.decrypt(encryptedData, privateKey)   // 私钥解密
   const res = crypt.sEncrypt(text, publicKey)   // 私钥加密
   const res = crypt.pDecrypt(text, publicKey)   // 公钥解密

2.uuid

生成唯一的appId

const { uuid } = require('hita-tool')

let id = uuid.getAppId()  //生成id

2.objFun

对象的特殊方法

1 对象参数按照key升序排序,并转换为&拼接的字符串,用法:

const { objFun } = require('hita-tool')
let obj = {
   b: "1",
   a: "2",
   c: "3"
}
let sortStr = objFun.ksortAndToString(obj)

2 将&拼接的字符串转换为对象,用法:

const { objFun } = require('hita-tool')
let obj = objFun.parseUrlObj(string)
1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago