@leofcoin/crypto
v0.2.37
Published
a simple nodejs/web crypto api
Downloads
109
Maintainers
Readme
@leofcoin/crypto
a simple nodejs/web crypto api
install
usage
import {
uint8ArrayToHex,
arrayBufferToHex,
hexToUint8Array,
randombytes,
createHash,
encrypt,
decrypt,
generateAesKey,
importAesKey,
exportAesKey,
encryptAes,
decryptAes,
generatePbkdf2,
pbkdf2
} from '@leofcoin/crypto'
checkout breaking changes
api
uint8ArrayToHex(uint8Array)
arrayBufferToHex(arrayBuffer)
hexToUint8Array(hex)
randombytes(length)
async createHash(data, algorithm)
async encrypt(string)
async decrypt({cipher, key, iv})
async generateAesKey(length)
async importAesKey(exported, format, length)
async exportAesKey(key, format)
async encryptAes(uint8Array, key, iv)
async decryptAes(uint8Array, key, iv)
async generatePbkdf2(password)
async pbkdf2(password, salt, iterations, length, hash)