Compare commits
No commits in common. "v0.1.0-develop.54" and "v0.1.0-develop.53" have entirely different histories.
v0.1.0-dev
...
v0.1.0-dev
|
@ -1,10 +1,3 @@
|
||||||
# [0.1.0-develop.54](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.53...v0.1.0-develop.54) (2023-09-08)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* add valid to CID ([565bed4](https://git.lumeweb.com/LumeWeb/libs5/commit/565bed46d511340854c443013c2be000c1e9302d))
|
|
||||||
|
|
||||||
# [0.1.0-develop.53](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.52...v0.1.0-develop.53) (2023-09-08)
|
# [0.1.0-develop.53](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.52...v0.1.0-develop.53) (2023-09-08)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.54",
|
"version": "0.1.0-develop.53",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.54",
|
"version": "0.1.0-develop.53",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/curves": "^1.1.0",
|
"@noble/curves": "^1.1.0",
|
||||||
"@noble/hashes": "^1.3.1",
|
"@noble/hashes": "^1.3.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.54",
|
"version": "0.1.0-develop.53",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
10
src/cid.ts
10
src/cid.ts
|
@ -52,16 +52,6 @@ export default class CID extends Multibase {
|
||||||
return new CID(type, new Multihash(bytes), size);
|
return new CID(type, new Multihash(bytes), size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static valid(bytes: Uint8Array): boolean {
|
|
||||||
try {
|
|
||||||
CID._init(bytes);
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static _init(bytes: Uint8Array): CID {
|
private static _init(bytes: Uint8Array): CID {
|
||||||
const type = bytes[0];
|
const type = bytes[0];
|
||||||
if (type === CID_TYPES.BRIDGE) {
|
if (type === CID_TYPES.BRIDGE) {
|
||||||
|
|
Loading…
Reference in New Issue