siwi-hash

siwi-hash md5 sha1 sha256 sha512

Usage no npm install needed!

<script type="module">
  import siwiHash from 'https://cdn.skypack.dev/siwi-hash';
</script>

README

node Build Status npm npm Github file size

siwi-hash

md5 sha1 sha256 sha512

install

use npm

npm install siwi-cache

use yarn

yarn add siwi-cache

Example

md5

参数 类型 是否必选 含义
data String | Buffer | Object 加密值 字符串或者对象 对象会自动进行 JSON.stringify()
const Hash = require('siwi-hash')

const hash = new Hash()

class Example {
    constructor() {
        this.init()
    }
    async init () {
        const data = {name: 'siwi', age: 25}
        const res = await hash.md5(data)
        console.log(res)
    }
}

module.exports = new Example()

输出 :be00a2b28f9359b45195866c32ff74a5

sha1 sha256 sha512 参考md5