Created
January 20, 2023 01:59
-
-
Save meandavejustice/c5226ce667a159368e51b8199d013ddc to your computer and use it in GitHub Desktop.
Regular expression for parsing CIDs from IPFS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CID_REGEXP = /(Qm[1-9A-HJ-NP-Za-km-z]{44,}?|b[A-Za-z2-7]{58,}?|B[A-Z2-7]{58,}?|z[1-9A-HJ-NP-Za-km-z]{48,}?|F[0-9A-F]{50,}?)/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use https://github.com/ipfs-shipyard/is-ipfs to verify CIDs