You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2021/04/06 02:10:37 UTC

[GitHub] [avro] subhashb commented on a change in pull request #1181: AVRO-1938: Add support for fingerprinting schemas

subhashb commented on a change in pull request #1181:
URL: https://github.com/apache/avro/pull/1181#discussion_r607438944



##########
File path: lang/py/avro/schema.py
##########
@@ -158,7 +159,77 @@ def canonical_properties(self):
             if key in props)
 
 
-class Schema(abc.ABC, CanonicalPropertiesMixin):
+class FingerprintMixin:
+    """
+    A Mixin to generate schema fingerprints for supported algorithms
+    """
+    _FP_TABLE = None
+    _EMPTY64 = 0xc15d213aa4d7a795
+
+    # All algorithms guaranteed by hashlib are supported
+    SUPPORTED_ALGORITHMS = set(hashlib.algorithms_guaranteed)

Review comment:
       The list of guaranteed algorithms is:
   ```
    'blake2b', 
    'blake2s',
    'md5',
    'sha1',
    'sha224',
    'sha256',
    'sha384',
    'sha3_224',
    'sha3_256',
    'sha3_384',
    'sha3_512',
    'sha512',
    'shake_128',
    'shake_256'
   ```
   
   - Should all of these be allowed, or should there be a restricted list? 
   - Algorithm names are treated case-insensitively. Are there algorithm name variations to be supported for compatibility with other language implementations?




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