How I can generate Account Hash for Cloudflare Images?

Hi everyone, I am trying to find an algorithm for generating an Account Hash for Cloudflare Images using Java. Does someone know how Cloudflare generate Account Hash for Images? And does it possible to generate Account Hash using Java?
12 Replies
zegevlier
zegevlier12mo ago
What do you mean by "Account Hash"? Could you give an example? Oh I see, I don't think that is something that is generated. That is just something you look up in the dashboard and store
Volodymyr Khandzhian
Thank you for your response) We are trying to understand does it is possible to generate it because we already store in configs Bearer, Default Image Key, Account Id. It is a very big number for us. We are trying to minimize the number of keys on the backend side.
Erisa
Erisa12mo ago
You can't generate it. The only way to retrieve it programatically is by calling an undocumented API endpoint, since it doesn't change it's recommended as zeg says to store it
Volodymyr Khandzhian
Okay, Thank you) I am sorry, Could we discuss it in private messages?
Erisa
Erisa12mo ago
GET /accounts/<account_id>/images/v1/account returns the encrypted_id in the result But its undocumented so it may change or be removed at any time without warning Why? I don't provide support in direct messages unless there's a very good reason it can't be public
Volodymyr Khandzhian
Sorry, I asked it because I was thinking that you didn't send me an undocumented endpoint in a public post @Erisa | Support Engineer Thank you for your help. Also, maybe you know how we can upload image in original dimension to Cloudflare Images? Now we are working on migration our media gallery to Cloudflare Images and we found that after uploading images to Cloudflare all of them resized to standard public sizes. Is it possible to upload images with original dimension?
Erisa
Erisa12mo ago
They should upload with their original dimensions and then be served with whatever size you applied on the variant. The default "public" variant is 1366x768 so you could either edit that or create and use your own variant
Erisa
Erisa12mo ago
Resize images · Cloudflare Image Optimization docs
Resizing images in Cloudflare Images works by creating variants of your image. Variants let you specify how images should be resized for different use …
Volodymyr Khandzhian
But we have a lot images with different dimensions and we want to save original dimension for all images. Is it possible?
Erisa
Erisa12mo ago
The variants will never resize an image higher than its original resolution, so you can create a variant with an extremely large size and it will work with any image up to that size
Volodymyr Khandzhian
Thank you very much. Yes, we put 1 000 000 x 1 000 000 and image saved with original dimension. Thank you)
Erisa
Erisa12mo ago
No problem
Want results from more Discord servers?
Add your server