Detail: Yarn: Accessor Hashlib

Overview: Yarn: Accessor Hashlib

Yarn.via_hashlib(include_name, include_class, encoding).to_bytes()
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.to_bytes()[source]

Return the byte signature for this container, suitable for passing to a cryptographic hash function.

>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).to_bytes()
b'YarnIndexHierarchyi\x00\x00\x00i\x00\x00\x00j\x00\x00\x00j\x00\x00\x00x\x00\x00\x00y\x00\x00\x00v\x00\x00\x00w\x00\x00\x00FrameIndexp\x00\x00\x00q\x00\x00\x00r\x00\x00\x00Indexa\x00\x00\x00b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00FrameIndexp\x00\x00\x00q\x00\x00\x00r\x00\x00\x00Indexc\x00\x00\x00d\x00\x00\x00\x00\x00\x00\x01\x01\x01FrameIndexp\x00\x00\x00q\x00\x00\x00r\x00\x00\x00Indexa\x00\x00\x00b\x00\x00\x00(\x00\x00\x00\x00\x00\x00\x00*\x00\x00\x00\x00\x00\x00\x00,\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00\x00\x00\x00\x00-\x00\x00\x00\x00\x00\x00\x00FrameIndexp\x00\x00\x00q\x00\x00\x00r\x00\x00\x00Indexc\x00\x00\x00d\x00\x00\x00\x00\x01\x01\x01\x00\x01'
Yarn.via_hashlib(include_name, include_class, encoding).md5()
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.md5()[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).md5().hexdigest()
dbd84f20d9fc3de36fa3956413a5352b
Yarn.via_hashlib(include_name, include_class, encoding).sha256()
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.sha256()[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).sha256().hexdigest()
b4d4605a723e1ab9e9333eb4a258292f3c89c4c8c02c148e6480c79e54184ad2
Yarn.via_hashlib(include_name, include_class, encoding).sha512()
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.sha512()[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).sha512().hexdigest()
d31e8f384689cadc1f14b18b7f3fd3eb91f1bb933b3826ad3cec4f43d0cc743985bd406a97cbf7f24b50f7d154c30bb0a400860a3ce3ba4a452be14ec8f2dac3
Yarn.via_hashlib(include_name, include_class, encoding).sha3_256()
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.sha3_256()[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).sha3_256().hexdigest()
4a2b94fae32e3aa223d7f55aab981380690b859d9835a5d463d927fc3b0e22d5
Yarn.via_hashlib(include_name, include_class, encoding).sha3_512()
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.sha3_512()[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).sha3_512().hexdigest()
6562658e9d2d6182205d6982c5b0ea005e5470b85e06071c0713b22390dd87d3a10c6d8a437615b4f3e431cc6162d6a9e44dce6568e564b6fad5fe597208b8eb
Yarn.via_hashlib(include_name, include_class, encoding).shake_128()
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.shake_128()[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).shake_128().hexdigest(8)
4b26ae91c224cf43
Yarn.via_hashlib(include_name, include_class, encoding).shake_256()
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.shake_256()[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).shake_256().hexdigest(8)
e1dd392f568d3e58
Yarn.via_hashlib(include_name, include_class, encoding).blake2b(*, digest_size, key, salt, person, fanout, depth, leaf_size, node_offset, node_depth, inner_size, last_node)
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.blake2b(*, digest_size=64, key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, node_depth=0, inner_size=0, last_node=False)[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).blake2b().hexdigest()
fcfa23bb62037fb084fb0de6cd75c3b0223b580c0e777b265551874b38f99a222040f8e148d651e6319f1d35ad4a55d0839a4825175bc13a6ed38809b297d342
Yarn.via_hashlib(include_name, include_class, encoding).blake2s(*, digest_size, key, salt, person, fanout, depth, leaf_size, node_offset, node_depth, inner_size, last_node)
via_hashlib

Interface for deriving cryptographic hashes from this container.

InterfaceHashlib.blake2s(*, digest_size=32, key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0, node_offset=0, node_depth=0, inner_size=0, last_node=False)[source]
>>> y = sf.Yarn.from_buses((sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame((np.arange(6).reshape(3,2) % 2).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='y')), name='i'), sf.Bus.from_frames((sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v'), sf.Frame((np.arange(6).reshape(3,2) % 3).astype(bool), index=('p', 'q', 'r'), columns=('c', 'd'), name='w')), name='j')), retain_labels=True)
>>> y
<Yarn>
<IndexHierarchy>
i                x     Frame
i                y     Frame
j                v     Frame
j                w     Frame
<<U1>            <<U1> <object>
>>> y.via_hashlib(include_name=False).blake2s().hexdigest()
7109826fdf713998da43abfd837073c8447a2d4ff5958a136d85c6e39ec016eb

Yarn: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Iterator | Accessor Hashlib | Accessor Type Clinic