@peculiar/webcrypto
Advanced tools
Comparing version
@@ -1,21 +0,13 @@ | ||
type NativeCrypto = Crypto; | ||
type NativeSubtleCrypto = SubtleCrypto; | ||
type NativeCryptoKey = CryptoKey; | ||
import * as core from "webcrypto-core"; | ||
declare namespace WebCrypto { | ||
export declare class Crypto implements core.NativeCrypto { | ||
public subtle: SubtleCrypto; | ||
public getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T; | ||
} | ||
class Crypto implements NativeCrypto { | ||
public subtle: SubtleCrypto; | ||
public getRandomValues<T extends Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null>(array: T): T; | ||
} | ||
class CryptoKey implements NativeCryptoKey { | ||
public algorithm: KeyAlgorithm; | ||
public extractable: boolean; | ||
public type: KeyType; | ||
public usages: KeyUsage[]; | ||
} | ||
export declare class CryptoKey implements core.NativeCryptoKey { | ||
public algorithm: KeyAlgorithm; | ||
public extractable: boolean; | ||
public type: KeyType; | ||
public usages: KeyUsage[]; | ||
} | ||
export = WebCrypto; |
@@ -1401,3 +1401,3 @@ // Copyright (c) 2019, Peculiar Ventures, All rights reserved. | ||
return new Promise((resolve, reject) => { | ||
const salt = this.prepareData(algorithm.salt); | ||
const salt = core.BufferSourceConverter.toArrayBuffer(algorithm.salt); | ||
const hash = algorithm.hash.name.replace("-", ""); | ||
@@ -1404,0 +1404,0 @@ crypto.pbkdf2(baseKey.data, Buffer.from(salt), algorithm.iterations, length >> 3, hash, (err, derivedBits) => { |
{ | ||
"name": "@peculiar/webcrypto", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A WebCrypto Polyfill for NodeJS", | ||
@@ -43,19 +43,19 @@ "repository": { | ||
"devDependencies": { | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.12.10", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^10.12.26", | ||
"coveralls": "^3.0.2", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.1.0", | ||
"nyc": "^13.2.0", | ||
"rollup": "^1.1.2", | ||
"rollup-plugin-typescript": "^1.0.0", | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.1.6" | ||
"typescript": "^3.3.3" | ||
}, | ||
"dependencies": { | ||
"@peculiar/asn1-schema": "^1.0.1", | ||
"@peculiar/json-schema": "^1.1.4", | ||
"@peculiar/asn1-schema": "^1.0.2", | ||
"@peculiar/json-schema": "^1.1.5", | ||
"asn1js": "^2.0.21", | ||
"pvtsutils": "^1.0.3", | ||
"tslib": "^1.9.3", | ||
"webcrypto-core": "^1.0.1" | ||
"webcrypto-core": "^1.0.4" | ||
}, | ||
@@ -62,0 +62,0 @@ "nyc": { |
69199
-0.11%1511
-0.33%Updated
Updated
Updated