class documentation
class ObjectFormat:
Constructor: ObjectFormat(name, type_num, oid_length, hex_length, ...)
Object format (hash algorithm) used in Git.
| Method | __init__ |
Initialize an object format. |
| Method | __repr__ |
Return repr. |
| Method | __str__ |
Return string representation. |
| Method | hash |
Hash data and return the digest. |
| Method | hash |
Hash data and return the hexadecimal digest. |
| Method | new |
Create a new hash object. |
| Instance Variable | hash |
Undocumented |
| Instance Variable | hex |
Undocumented |
| Instance Variable | name |
Undocumented |
| Instance Variable | oid |
Undocumented |
| Instance Variable | type |
Undocumented |
def __init__(self, name:
str, type_num: int, oid_length: int, hex_length: int, hash_func: Callable[ [], HASH]):
¶
Initialize an object format.
| Parameters | |
name:str | Name of the format (e.g., "sha1", "sha256") |
typeint | Format type number used in Git |
oidint | Length of the binary object ID in bytes |
hexint | Length of the hexadecimal object ID in characters |
hashCallable[ | Hash function from hashlib |