Python hashlib.blake2s() Examples

The following are 10 code examples of hashlib.blake2s(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module hashlib , or try the search function .
Example #1
Source File: rarfile.py    From Lector with GNU General Public License v3.0 5 votes vote down vote up
def _blake2s(self, ofs, depth, is_last):
        return blake2s(node_offset=ofs, node_depth=depth, last_node=is_last,
                       depth=2, inner_size=32, fanout=self.parallelism) 
Example #2
Source File: helper.py    From slim with zlib License 5 votes vote down vote up
def _create_signature(secret: bytes, s):
    # hash = hashlib.blake2s(_signature_encode(s), key=secret[:32]) py3.6+
    m = hmac.new(secret, digestmod=hashlib.sha256)
    m.update(_value_encode(s))
    return m.hexdigest() 
Example #3
Source File: rarfile.py    From addon with GNU General Public License v3.0 5 votes vote down vote up
def _blake2s(self, ofs, depth, is_last):
        return blake2s(node_offset=ofs, node_depth=depth, last_node=is_last,
                       depth=2, inner_size=32, fanout=self.parallelism) 
Example #4
Source File: rar_define.py    From carpe with Apache License 2.0 5 votes vote down vote up
def _blake2s(self, ofs, depth, is_last):
        return blake2s(node_offset=ofs, node_depth=depth, last_node=is_last,
                       depth=2, inner_size=32, fanout=self.parallelism) 
Example #5
Source File: hashable_list.py    From research with MIT License 5 votes vote down vote up
def hash(x): return blake2s(x).digest()

# Next power of 2 >= the input 
Example #6
Source File: prime_shuffle.py    From research with MIT License 5 votes vote down vote up
def hash(x): return blake2s(x).digest()[:32] 
Example #7
Source File: fisher_yates_shuffle.py    From research with MIT License 5 votes vote down vote up
def hash(x): return blake2s(x).digest()[:32] 
Example #8
Source File: swap_or_not_shuffle.py    From research with MIT License 5 votes vote down vote up
def hash(x): return blake2s(x).digest()[:32] 
Example #9
Source File: feistel_shuffle.py    From research with MIT License 5 votes vote down vote up
def hash(x): return blake2s(x).digest()[:32] 
Example #10
Source File: rarfile.py    From bazarr with GNU General Public License v3.0 5 votes vote down vote up
def _blake2s(self, ofs, depth, is_last):
        return blake2s(node_offset=ofs, node_depth=depth, last_node=is_last,
                       depth=2, inner_size=32, fanout=self.parallelism)