title: Cannot get the same md5 hash of photo client-side to successfully pass Firebase Storage security rules
body: <p>I'd like to upload files with uniform names by generating a md5 hash client-side. However, I didn't manage to successfully pass the Firebase Storage security rules at this point:</p>
  
  <pre><code>match /{userUid}/{photoHash} {
    allow create: if request.resource.md5Hash == photoHash;
  }
  </code></pre>
  
  <p>Client-side code snippet uploading the photo:</p>
  
  <pre><code>const compressedPhoto = await this.compressPhoto(photo)
  const base64 = await this.toBase64(compressedPhoto)
  
  const photoHash = CryptoJS.MD5(compressedPhoto).toString(CryptoJS.enc.Base64)
  
  const uploadTask = this.storageRef.child(photoHash).put(compressedPhoto)
  </code></pre>