@walletconnect/crypto
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "@walletconnect/crypto", | ||
"description": "Isomorphic Cryptography Library for AES, HMAC and SHA2", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "WalletConnect <walletconnect.org>", | ||
@@ -42,5 +42,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"@walletconnect/encoding": "^1.0.0", | ||
"@walletconnect/encoding": "^1.0.1", | ||
"@walletconnect/environment": "^1.0.0", | ||
"@walletconnect/randombytes": "^1.0.1", | ||
"@walletconnect/randombytes": "^1.0.2", | ||
"aes-js": "^3.1.2", | ||
@@ -47,0 +47,0 @@ "hash.js": "^1.1.7" |
@@ -14,3 +14,3 @@ # iso-crypto [![npm version](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto.svg)](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto) | ||
```typescript | ||
import * as isoCrypto from 'iso-crypto'; | ||
import * as isoCrypto from "iso-crypto"; | ||
@@ -26,4 +26,4 @@ const length = 32; | ||
```typescript | ||
import * as isoCrypto from 'iso-crypto'; | ||
import * as encUtils from 'enc-utils'; | ||
import * as isoCrypto from "iso-crypto"; | ||
import * as encoding from "@walletconnect/encoding"; | ||
@@ -33,4 +33,4 @@ const key = isoCrypto.randomBytes(32); | ||
const str = 'test message to encrypt'; | ||
const msg = encUtils.utf8ToArray(str); | ||
const str = "test message to encrypt"; | ||
const msg = encoding.utf8ToArray(str); | ||
@@ -47,4 +47,4 @@ const ciphertext = await isoCrypto.aesCbcEncrypt(iv, key, msg); | ||
```typescript | ||
import * as isoCrypto from 'iso-crypto'; | ||
import * as encUtils from 'enc-utils'; | ||
import * as isoCrypto from "iso-crypto"; | ||
import * as encoding from "@walletconnect/encoding"; | ||
@@ -54,4 +54,4 @@ const key = isoCrypto.randomBytes(32); | ||
const macKey = encUtils.concatArrays(iv, key); | ||
const dataToMac = encUtils.concatArrays(iv, key, msg); | ||
const macKey = encoding.concatArrays(iv, key); | ||
const dataToMac = encoding.concatArrays(iv, key, msg); | ||
@@ -68,13 +68,13 @@ const mac = await isoCrypto.hmacSha256Sign(macKey, dataToMac); | ||
```typescript | ||
import * as isoCrypto from 'iso-crypto'; | ||
import * as encUtils from 'enc-utils'; | ||
import * as isoCrypto from "iso-crypto"; | ||
import * as encoding from "@walletconnect/encoding"; | ||
// SHA256 | ||
const str = 'test message to hash'; | ||
const msg = encUtils.utf8ToArray(str); | ||
const str = "test message to hash"; | ||
const msg = encoding.utf8ToArray(str); | ||
const hash = await isoCrypto.sha256(str); | ||
// SHA512 | ||
const str = 'test message to hash'; | ||
const msg = encUtils.utf8ToArray(str); | ||
const str = "test message to hash"; | ||
const msg = encoding.utf8ToArray(str); | ||
const hash = await isoCrypto.sha512(str); | ||
@@ -81,0 +81,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
334597
1803