diff --git a/extensions/crypto/description.yml b/extensions/crypto/description.yml index 72f3ba5..9147fec 100644 --- a/extensions/crypto/description.yml +++ b/extensions/crypto/description.yml @@ -4,7 +4,7 @@ extension: version: 1.0.0 language: C++ build: cmake - license: Apache-2.0 + license: MIT excluded_platforms: "windows_amd64_rtools;windows_amd64" maintainers: - rustyconover @@ -15,7 +15,46 @@ repo: docs: hello_world: | - SELECT * from read_csv('seq 1 100 | grep 2 |'); + -- Calculate the MD5 hash value of 'abcdef' + SELECT crypto_hash('md5', 'abcdef'); + ┌──────────────────────────────────┐ + │ crypto_hash('md5', 'abcdef') │ + │ varchar │ + ├──────────────────────────────────┤ + │ e80b5017098950fc58aad83c8c14978e │ + └──────────────────────────────────┘ + + -- Calculate a HMAC + SELECT crypto_hmac('sha2-256', 'secret key', 'secret message'); + ┌──────────────────────────────────────────────────────────────────┐ + │ crypto_hmac('sha2-256', 'secret key', 'secret message') │ + │ varchar │ + ├──────────────────────────────────────────────────────────────────┤ + │ 2df792e08cefdc0ea9900c67c93cbe66b98231b829a5dccd3857a03baac35963 │ + └──────────────────────────────────────────────────────────────────┘ extended_description: | - This extension, `crypto`, adds cryptographic hash functions and - the ability to calculate a HMAC to DuckDB's SQL engine. + `crypto` provides two functions: + + - `crypto_hash` applies cryptographically secure hash functions + and returns the result as a hex encoded value. + + - `crypto_hmac` calculates the HMAC using a secret key and a + specific hash function. + + The supported hash functions are: + - `blake2b-512` + - `keccak224` + - `keccak256` + - `keccak384` + - `keccak512` + - `md4` + - `md5` + - `sha1` + - `sha2-224` + - `sha2-256` + - `sha2-384` + - `sha2-512` + - `sha3-224` + - `sha3-256` + - `sha3-384` + - `sha3-512` \ No newline at end of file diff --git a/extensions/crypto/docs/function_descriptions.csv b/extensions/crypto/docs/function_descriptions.csv index da852a3..ecff328 100644 --- a/extensions/crypto/docs/function_descriptions.csv +++ b/extensions/crypto/docs/function_descriptions.csv @@ -1,3 +1,3 @@ function,description,comment,example -crypto_hash,"Calculate the value of a hash function","","select crypto_hash('md5', 'test');" -crypto_hmac,"Calculate a HMAC value","","select crypto_hmac('sha2-256', 'secret key', 'secret message');" +"crypto_hash","Apply a cryptographic hash function specified as the first argument to the data supplied as the second argument.","","SELECT crypto_hash('md5', 'test');" +"crypto_hmac","Calculate a HMAC value","","SELECT crypto_hmac('sha2-256', 'secret key', 'secret message');"