Created
September 6, 2018 22:52
-
-
Save asselstine/ba624e4134819787fc0e5050ae985150 to your computer and use it in GitHub Desktop.
An example of using MedCredits IPFS-backed encrypted HIPAA-compliant storage
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
import { ipfsStorage } from 'medcredits' | |
async function getCaseDetails (ipfsHash, encryptionKey) { | |
const detailsJson = await ipfsStorage.downloadJson(ipfsHash, encryptionKey) | |
const details = JSON.parse(detailsJson) | |
const [firstImageDataUrl, secondImageDataUrl] = await Promise.all([ | |
ipfsStorage.downloadImage(details.firstImageHash, props.caseKey), | |
ipfsStorage.downloadImage(details.secondImageHash, props.caseKey) | |
]) | |
return { | |
details, | |
firstImageDataUrl, | |
secondImageDataUrl | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🌮