Additional __PURE__ annotations (#1787)
* Additional __PURE__ annotations * Revert as const (This _could_ yield breaking external changes)
This commit is contained in:
@@ -37,4 +37,4 @@ export function blake2AsU8a (data: HexString | Uint8Array | string, bitLength: 6
|
||||
* @name blake2AsHex
|
||||
* @description Creates a blake2b hex from the input.
|
||||
*/
|
||||
export const blake2AsHex = createAsHex(blake2AsU8a);
|
||||
export const blake2AsHex = /*#__PURE__*/ createAsHex(blake2AsU8a);
|
||||
|
||||
@@ -39,10 +39,10 @@ export function hmacShaAsU8a (key: Uint8Array | string, data: Uint8Array, bitLen
|
||||
* @name hmacSha256AsU8a
|
||||
* @description creates a Hmac Sha256 Uint8Array from the key & data
|
||||
*/
|
||||
export const hmacSha256AsU8a = createSha(256);
|
||||
export const hmacSha256AsU8a = /*#__PURE__*/ createSha(256);
|
||||
|
||||
/**
|
||||
* @name hmacSha512AsU8a
|
||||
* @description creates a Hmac Sha512 Uint8Array from the key & data
|
||||
*/
|
||||
export const hmacSha512AsU8a = createSha(512);
|
||||
export const hmacSha512AsU8a = /*#__PURE__*/ createSha(512);
|
||||
|
||||
@@ -42,4 +42,4 @@ export const keccak512AsU8a = /*#__PURE__*/ createBitHasher(512, keccakAsU8a);
|
||||
* @name keccakAsHex
|
||||
* @description Creates a keccak hex string from the input.
|
||||
*/
|
||||
export const keccakAsHex = createAsHex(keccakAsU8a);
|
||||
export const keccakAsHex = /*#__PURE__*/ createAsHex(keccakAsU8a);
|
||||
|
||||
@@ -5,4 +5,4 @@ import { secp256k1DeriveHard } from '../secp256k1/deriveHard.js';
|
||||
import { secp256k1PairFromSeed } from '../secp256k1/pair/fromSeed.js';
|
||||
import { createSeedDeriveFn } from './hdkdDerive.js';
|
||||
|
||||
export const keyHdkdEcdsa = createSeedDeriveFn(secp256k1PairFromSeed, secp256k1DeriveHard);
|
||||
export const keyHdkdEcdsa = /*#__PURE__*/ createSeedDeriveFn(secp256k1PairFromSeed, secp256k1DeriveHard);
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
import { ed25519DeriveHard, ed25519PairFromSeed } from '../ed25519/index.js';
|
||||
import { createSeedDeriveFn } from './hdkdDerive.js';
|
||||
|
||||
export const keyHdkdEd25519 = createSeedDeriveFn(ed25519PairFromSeed, ed25519DeriveHard);
|
||||
export const keyHdkdEd25519 = /*#__PURE__*/ createSeedDeriveFn(ed25519PairFromSeed, ed25519DeriveHard);
|
||||
|
||||
@@ -27,4 +27,4 @@ export function randomAsU8a (length = 32): Uint8Array {
|
||||
* @name randomAsHex
|
||||
* @description Creates a hex string filled with random bytes.
|
||||
*/
|
||||
export const randomAsHex = createAsHex(randomAsU8a);
|
||||
export const randomAsHex = /*#__PURE__*/ createAsHex(randomAsU8a);
|
||||
|
||||
@@ -5,4 +5,4 @@ import { sr25519DeriveKeypairHard } from '@polkadot/wasm-crypto';
|
||||
|
||||
import { createDeriveFn } from './derive.js';
|
||||
|
||||
export const sr25519DeriveHard = createDeriveFn(sr25519DeriveKeypairHard);
|
||||
export const sr25519DeriveHard = /*#__PURE__*/ createDeriveFn(sr25519DeriveKeypairHard);
|
||||
|
||||
@@ -5,4 +5,4 @@ import { sr25519DeriveKeypairSoft } from '@polkadot/wasm-crypto';
|
||||
|
||||
import { createDeriveFn } from './derive.js';
|
||||
|
||||
export const sr25519DeriveSoft = createDeriveFn(sr25519DeriveKeypairSoft);
|
||||
export const sr25519DeriveSoft = /*#__PURE__*/ createDeriveFn(sr25519DeriveKeypairSoft);
|
||||
|
||||
@@ -44,4 +44,4 @@ export function xxhashAsU8a (data: HexString | Buffer | Uint8Array | string, bit
|
||||
* @name xxhashAsHex
|
||||
* @description Creates a xxhash64 hex from the input.
|
||||
*/
|
||||
export const xxhashAsHex = createAsHex(xxhashAsU8a);
|
||||
export const xxhashAsHex = /*#__PURE__*/ createAsHex(xxhashAsU8a);
|
||||
|
||||
@@ -10,13 +10,13 @@ import { u8aEq } from './eq.js';
|
||||
import { u8aToU8a } from './toU8a.js';
|
||||
|
||||
/** @internal */
|
||||
export const U8A_WRAP_ETHEREUM = u8aToU8a('\x19Ethereum Signed Message:\n');
|
||||
export const U8A_WRAP_ETHEREUM = /*#__PURE__*/ u8aToU8a('\x19Ethereum Signed Message:\n');
|
||||
|
||||
/** @internal */
|
||||
export const U8A_WRAP_PREFIX = u8aToU8a('<Bytes>');
|
||||
export const U8A_WRAP_PREFIX = /*#__PURE__*/ u8aToU8a('<Bytes>');
|
||||
|
||||
/** @internal */
|
||||
export const U8A_WRAP_POSTFIX = u8aToU8a('</Bytes>');
|
||||
export const U8A_WRAP_POSTFIX = /*#__PURE__*/ u8aToU8a('</Bytes>');
|
||||
|
||||
const WRAP_LEN = U8A_WRAP_PREFIX.length + U8A_WRAP_POSTFIX.length;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user