Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
IPFS CID transcoding
node v6.17.1
version:
master
endpoint
share
tweet
require("bs58") var hash = 'QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB' var CID = require('cids') id0 = new CID(hash)
id1 = id0.toV1() 'localhost:8080/ipfs/' + id1.toBaseEncodedString('base32')
new CID(id1.toBaseEncodedString('base16')).toV0().toBaseEncodedString('base58btc') == hash
new CID('QmRXJFzhtsAn9NkeFjv5Vf3ZPKBxjjzuV6BPVYJCqTvStQ')
new CID('QmRXJFzhtsAn9NkeFjv5Vf3ZPKBxjjzuV6BPVYJCqTvStQ').toV1().toBaseEncodedString('base16')
Loading…
no comments
sign in
to comment