Adjust blakejs commonjs imports (#809)

This commit is contained in:
Jaco Greeff
2020-12-17 12:03:21 +01:00
committed by GitHub
parent 4c121e6f50
commit 1061df6e4a
+2 -2
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { blake2b as blakejs } from 'blakejs';
import js from 'blakejs';
import { u8aToU8a } from '@polkadot/util';
import { blake2b, isReady } from '@polkadot/wasm-crypto';
@@ -25,5 +25,5 @@ export function blake2AsU8a (data: Uint8Array | string, bitLength = 256, key: Ui
return isReady() && !onlyJs
? blake2b(u8aToU8a(data), u8aToU8a(key), byteLength)
: blakejs(u8aToU8a(data), key, byteLength);
: js.blake2b(u8aToU8a(data), key, byteLength);
}