Comparing version 0.5.6 to 0.5.7
@@ -0,1 +1,11 @@ | ||
<a name="0.5.7"></a> | ||
## [0.5.7](https://github.com/multiformats/js-cid/compare/v0.5.6...v0.5.7) (2018-12-06) | ||
### Bug Fixes | ||
* stricter validation for CID v1 to v0 conversion ([0bd7318](https://github.com/multiformats/js-cid/commit/0bd7318)) | ||
<a name="0.5.6"></a> | ||
@@ -2,0 +12,0 @@ ## [0.5.6](https://github.com/ipld/js-cid/compare/v0.5.5...v0.5.6) (2018-11-22) |
{ | ||
"name": "cids", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"description": "CID Implementation in JavaScript", | ||
@@ -25,3 +25,3 @@ "leadMaintainer": "Volker Mische <volker.mische@gmail.com>", | ||
"type": "git", | ||
"url": "git://github.com/ipld/js-cid.git" | ||
"url": "git://github.com/multiformats/js-cid.git" | ||
}, | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/ipld/js-cid/issues" | ||
"url": "https://github.com/multiformats/js-cid/issues" | ||
}, | ||
@@ -49,4 +49,3 @@ "dependencies": { | ||
"multihashing": "~0.3.2", | ||
"multihashing-async": "~0.5.1", | ||
"pre-commit": "^1.2.2" | ||
"multihashing-async": "~0.5.1" | ||
}, | ||
@@ -53,0 +52,0 @@ "engines": { |
@@ -5,8 +5,8 @@ # js-cid | ||
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) | ||
[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-cid/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-cid?branch=master) | ||
[![Dependency Status](https://david-dm.org/ipld/js-cid.svg?style=flat-square)](https://david-dm.org/ipld/js-cid) | ||
[![Coverage Status](https://coveralls.io/repos/github/multiformats/js-cid/badge.svg?branch=master)](https://coveralls.io/github/multiformats/js-cid?branch=master) | ||
[![Dependency Status](https://david-dm.org/multiformats/js-cid.svg?style=flat-square)](https://david-dm.org/multiformats/js-cid) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/ipld/js-cid.svg)](https://greenkeeper.io/) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/multiformats/js-cid.svg)](https://greenkeeper.io/) | ||
> [CID](https://github.com/ipld/cid) implementation in JavaScript. | ||
> [CID](https://github.com/multiformats/cid) implementation in JavaScript. | ||
@@ -147,3 +147,3 @@ ## Lead Maintainer | ||
Contributions welcome. Please check out [the issues](https://github.com/ipld/js-cid/issues). | ||
Contributions welcome. Please check out [the issues](https://github.com/multiformats/js-cid/issues). | ||
@@ -150,0 +150,0 @@ Check out our [contributing document](https://github.com/ipfs/community/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). |
@@ -7,3 +7,2 @@ 'use strict' | ||
const codecs = require('multicodec/src/base-table') | ||
const multihash = require('multihashes') | ||
const CIDUtil = require('./cid-util') | ||
@@ -31,3 +30,3 @@ const withIs = require('class-is') | ||
* Class representing a CID `<mbase><version><mcodec><mhash>` | ||
* , as defined in [ipld/cid](https://github.com/ipld/cid). | ||
* , as defined in [ipld/cid](https://github.com/multiformats/cid). | ||
* @class CID | ||
@@ -152,3 +151,3 @@ */ | ||
multicodec.getCodeVarint(this.codec), | ||
multihash.prefix(this.multihash) | ||
mh.prefix(this.multihash) | ||
]) | ||
@@ -167,2 +166,12 @@ } | ||
const { name, length } = mh.decode(this.multihash) | ||
if (name !== 'sha2-256') { | ||
throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0') | ||
} | ||
if (length !== 32) { | ||
throw new Error('Cannot convert non 32 byte multihash CID to CIDv0') | ||
} | ||
return new _CID(0, this.codec, this.multihash) | ||
@@ -169,0 +178,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
521005
5
0