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

multiformats

Package Overview
Dependencies
Maintainers
1
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multiformats - npm Package Compare versions

Comparing version 4.3.5 to 4.4.0

cjs/src/hashes/identity.js

10

cjs/browser-test/test-multihash.js

@@ -7,2 +7,3 @@ 'use strict';

var crypto = require('crypto');
var identity = require('../src/hashes/identity.js');
var assert = require('assert');

@@ -72,2 +73,11 @@ var validMultihash = require('./fixtures/valid-multihash.js');

});
test('hash identity', async () => {
const hash = await identity.digest(bytes.fromString('test'));
same(hash.code, identity.code);
same(identity.code, 0);
same(hash.digest, bytes.fromString('test'));
const hash2 = digest.decode(hash.bytes);
same(hash2.code, identity.code);
same(hash2.bytes, hash.bytes);
});
});

@@ -74,0 +84,0 @@ describe('decode', () => {

@@ -7,2 +7,3 @@ 'use strict';

var sha2 = require('../src/hashes/sha2.js');
var identity = require('../src/hashes/identity.js');
var assert = require('assert');

@@ -72,2 +73,11 @@ var validMultihash = require('./fixtures/valid-multihash.js');

});
test('hash identity', async () => {
const hash = await identity.digest(bytes.fromString('test'));
same(hash.code, identity.code);
same(identity.code, 0);
same(hash.digest, bytes.fromString('test'));
const hash2 = digest.decode(hash.bytes);
same(hash2.code, identity.code);
same(hash2.bytes, hash.bytes);
});
});

@@ -74,0 +84,0 @@ describe('decode', () => {

@@ -15,2 +15,3 @@ import {

} from '../src/hashes/sha2-browser.js';
import identity from '../src/hashes/identity.js';
import {

@@ -75,2 +76,11 @@ decode as decodeDigest,

});
test('hash identity', async () => {
const hash = await identity.digest(fromString('test'));
same(hash.code, identity.code);
same(identity.code, 0);
same(hash.digest, fromString('test'));
const hash2 = decodeDigest(hash.bytes);
same(hash2.code, identity.code);
same(hash2.bytes, hash.bytes);
});
});

@@ -77,0 +87,0 @@ describe('decode', () => {

@@ -15,2 +15,3 @@ import {

} from '../src/hashes/sha2.js';
import identity from '../src/hashes/identity.js';
import {

@@ -75,2 +76,11 @@ decode as decodeDigest,

});
test('hash identity', async () => {
const hash = await identity.digest(fromString('test'));
same(hash.code, identity.code);
same(identity.code, 0);
same(hash.digest, fromString('test'));
const hash2 = decodeDigest(hash.bytes);
same(hash2.code, identity.code);
same(hash2.bytes, hash.bytes);
});
});

@@ -77,0 +87,0 @@ describe('decode', () => {

8

package.json
{
"name": "multiformats",
"version": "4.3.5",
"version": "4.4.0",
"description": "Interface for multihash, multicodec, multibase and CID",

@@ -91,2 +91,7 @@ "scripts": {

},
"./hashes/identity": {
"require": "./cjs/src/hashes/identity.js",
"import": "./esm/src/hashes/identity.js",
"browser": "./esm/src/hashes/identity.js"
},
"./codecs/codec": {

@@ -160,2 +165,3 @@ "require": "./cjs/src/codecs/codec.js",

"./hashes/sha2": "./cjs/src/hashes/sha2-browser.js",
"./hashes/identity": "./cjs/src/hashes/identity.js",
"./codecs/codec": "./cjs/src/codecs/codec.js",

@@ -162,0 +168,0 @@ "./codecs/json": "./cjs/src/codecs/json.js",

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