MCPcopy Index your code
hub / github.com/borgbackup/borg / init_from_random_data

Method init_from_random_data

src/borg/crypto/key.py:360–366  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

358 self.chunk_seed = chunk_seed
359
360 def init_from_random_data(self):
361 data = os.urandom(100)
362 chunk_seed = bytes_to_int(data[96:100])
363 # Convert to signed int32
364 if chunk_seed & 0x80000000:
365 chunk_seed = chunk_seed - 0xFFFFFFFF - 1
366 self.init_from_given_data(crypt_key=data[0:64], id_key=data[64:96], chunk_seed=chunk_seed)
367
368 def init_ciphers(self, manifest_data=None):
369 enc_key, enc_hmac_key = self.crypt_key[0:32], self.crypt_key[32:]

Callers 2

init_from_random_dataMethod · 0.45
createMethod · 0.45

Calls 1

init_from_given_dataMethod · 0.95

Tested by

no test coverage detected