1.0.3 • Published 11 months ago

@biglup/is-cid v1.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

is-cid

Utils to properly validate CIDs to remove false-positives. This package works with both CJS and ESM.

Example

import * as CidValidator from '@biglup/is-cid';

CidValidator.validate('QmYjtig7VJQ6XsnUjqqJvj7QaMcCAwtrgNdahSiFofrE7o') // true (CIDv0)
CidValidator.validate('bafybeiasb5vpmaounyilfuxbd3lryvosl4yefqrfahsb2esg46q6tu6y5q') // true (CIDv1 in Base32)
CidValidator.validate('zdj7WWeQ43G6JJvLWQWZpyHuAMq6uYWRjkBXFad11vE2LHhQ7') // true (CIDv1 in Base58btc)
CidValidator.validate('xxxxx') // false

Install

$ npm i @biglup/is-cid

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago