You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/07/22 16:22:35 UTC

[GitHub] [couchdb] rnewson edited a comment on pull request #3024: Pass fdb key to the encode_fun

rnewson edited a comment on pull request #3024:
URL: https://github.com/apache/couchdb/pull/3024#issuecomment-662550336


   With this feature, we can add aegis support with an encode_fun like this;
   
   ```
       EncodeFun = fun
           (encode, Key, Term) ->
               Bin = term_to_binary(Term, [compressed, {minor_version, 2}]),
               aegis:encrypt(TxDb, Key, Bin);
           (decode, Key, Ciphertext) ->
               Bin = aegis:decrypt(TxDb, Key, Ciphertext),
               binary_to_term(Bin, [safe])
       end.
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org