Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@polkadot/util-crypto

Package Overview
Dependencies
Maintainers
1
Versions
1357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/util-crypto - npm Package Compare versions

Comparing version 0.15.2 to 0.15.3

2

package.json
{
"name": "@polkadot/util-crypto",
"version": "0.15.2",
"version": "0.15.3",
"description": "A collection of useful crypto utilities for @polkadot",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,5 +6,5 @@ 'use strict';

// of the ISC license. See the LICENSE file for details.
var hexAddPrefix = require('@polkadot/util/hex/addPrefix');
var u8aToHex = require('@polkadot/util/u8a/toHex');
var xxhash64AsRaw = require('./xxhash64/asRaw');
var xxhashAsU8a = require('./asU8a');

@@ -25,11 +25,3 @@ /**

var strLength = Math.ceil(bitLength / 4);
var iterations = Math.ceil(strLength / 8);
var result = xxhash64AsRaw(data, 0);
for (var seed = 1; seed < iterations; seed++) {
result += xxhash64AsRaw(data, seed);
}
return hexAddPrefix(result.substr(0, strLength));
return u8aToHex(xxhashAsU8a(data, bitLength));
};

@@ -6,6 +6,4 @@ 'use strict';

// of the ISC license. See the LICENSE file for details.
var hexToU8a = require('@polkadot/util/hex/toU8a');
var xxhash64AsBn = require('./xxhash64/asBn');
var xxhashAsHex = require('./asHex');
/**

@@ -25,3 +23,11 @@ @name xxhashAsU8a

return hexToU8a(xxhashAsHex(data, bitLength));
var byteLength = Math.ceil(bitLength / 8);
var iterations = Math.ceil(bitLength / 64);
var u8a = new Uint8Array(byteLength);
for (var seed = 0; seed < iterations; seed++) {
u8a.set(xxhash64AsBn(data, seed).toArray('le', 8), seed * 8);
}
return u8a;
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc