The reason why i ask this is that final() from crypto can only output hexadecimal, binary or ascii data. It is designed to carry data stored in binary format across the network. This process will increase the size by 33%.
Team Somatus
The common method to store images in a database is to convert the image to base64 data before storing the data.
You can use btoa() and atob() to convert to and from base64 encoding.
Base64 is a binary to a text encoding scheme that represents binary data in an ascii string format. Remember base64 is primarily intended for representing binary data in ascii, for storing in a char field in a database or sending via. Title and first sentence ask different question. There appears to be some confusion in the comments regarding what these functions accept/return, so… btoa().
Ask yourself do you really need to do this? You can determine if a given string is valid base64 encoded string, but you cannot determine if a string is base64 encoded or not.
Editor's Choice
- Nor'easter Forecast: Get Ready For Coastal Storm! Ecast Maps What You Need To Know About The Storm
- Rohit Saraf's Height: How Tall Is The Actor? Suresh Saraf Full Bio Height Age Girlfriend Family And More
- Airpods Pro 3: Choosing The Best Ear Tip Size How To Use Fit Test With For Fit
- Rock Like The King: The Ultimate Elvis Mask Guide Box Manual Snes Box Snes Manual Usa Etsy
- Dns Over Https (doh): Enhanced Security & Privacy Explained What Is Doh Meaning Benefits And Risks