Skip to content

Instantly share code, notes, and snippets.

@gmac
Last active September 10, 2018 12:23
Show Gist options
  • Save gmac/d8a2bb8a282b6e21d42ac1c6d84a37df to your computer and use it in GitHub Desktop.
Save gmac/d8a2bb8a282b6e21d42ac1c6d84a37df to your computer and use it in GitHub Desktop.
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