Last active
September 10, 2018 12:23
-
-
Save gmac/d8a2bb8a282b6e21d42ac1c6d84a37df to your computer and use it in GitHub Desktop.
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 Evaporate from 'evaporate'; | |
import sparkMD5 from 'spark-md5'; | |
import sha256 from 'js-sha256'; | |
const uploader = Evaporate.create({ | |
signerUrl: '/uploads/auth', | |
aws_key: 'AWS_PUBLIC_KEY', | |
bucket: 'your-bucket-name', | |
cloudfront: true, | |
computeContentMd5: true, | |
cryptoMd5Method: (d) => btoa(sparkMD5.ArrayBuffer.hash(d, true)), | |
cryptoHexEncodedHash256: sha256, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment