okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
79b55b3
main
1- module ( albedo_image_store_test_support ). 2- export ([ legacy_payload / 2 , exists / 1 , legacy_fingerprint / 3 ]). 3 4%% A transcript row as written before images were stored: the payload inline. 5legacy_payload ( Text , Data ) -> 6term_to_binary ({ 1 , { user_image , Text , { image , << "image/png" >>, Data , 2 , 3 , 45 }}}). 7 8exists ( Path ) -> filelib : is_regular ( Path ). 9 10%% What rolling's fingerprint returned for #(Source, [UserImage(Text, _)]) 11%% before images were stored. 12legacy_fingerprint ( Source , Text , Data ) -> 13Term = { Source , [{ user_image , Text , { image , << "image/png" >>, Data , 2 , 3 , 45 }}]}, 14binary : encode_hex ( crypto : hash ( sha256 , term_to_binary ( Term , [ deterministic ])), lowercase ).