Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function base58check(data) {
return Base58.encode(concat([data, hexDataSlice(sha256(sha256(data)), 0, 4)]));
}
const _constructorGuard = {};
let content = yield resolver.contenthash(nodehash).then((hash) => {
if (hash === "0x") {
return "";
}
if (hash.substring(0, 10) === "0xe3010170" && ethers.utils.isHexString(hash, 38)) {
return Base58.encode(ethers.utils.hexDataSlice(hash, 4)) + " (IPFS)";
}
return hash + " (unknown format)";
}, (error) => (""));
if (content) {
function base58check(data: Uint8Array): string {
return Base58.encode(concat([ data, hexDataSlice(sha256(sha256(data)), 0, 4) ]));
}