Zkplo opened a new issue, #10991:
URL: https://github.com/apache/inlong/issues/10991

   ### Description
   
   - parent issue #10796 
   - Official documentation of MySQL functions: 
https://dev.mysql.com/doc/refman/8.4/en/encryption-functions.html#function_sha1
   
   SHA1(str) or SHA( str ): Compute the SHA-1 160 bit checksum of a string, 
which is returned as a string of 40 hexadecimal digits. If the parameter is 
NULL, then NULL.
   
   SHA2(str, hash_length): Calculates the SHA-2 family of hash functions 
(SHA-224, SHA-256, SHA-384, and SHA-512). The first argument is the plaintext 
string to be hashed. The second argument indicates the desired bit length of 
the result, which must have a value of 224, 256, 384, 512, or 0 (which is 
equivalent to 256). If either argument is NULL or the hash length is not one of 
the permitted values, the return value is NULL. Otherwise, the function result 
is a hash value containing the desired number of bits.
   
   ### Use case
   
   ```sql
   sha(null) or sha1(null) -> NULL
   sha('abc') or sha1('abc') -> a9993e364706816aba3e25717850c26c9cd0d89d
   
   SHA2('abc', 224) -> 23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7
   sha2(null,224) or sha2('abc',null)  -> null
   ```
   
   ### Are you willing to submit PR?
   
   - [X] Yes, I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to