MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / _bg_encrypt_file

Function _bg_encrypt_file

Scripts/ButSystem.py:536–566  ·  view source on GitHub ↗

Encrypt tmp_plain -> out_enc in a background thread, then call finalize_fn(success:bool, err:str|None).

(tmp_plain: str, out_enc: str, finalize_fn)

Source from the content-addressed store, hash-verified

534 multipart parts on all clients.
535 """
536 if file_storage is None:
537 return None
538 try:
539 cl = getattr(file_storage, "content_length", None)
540 if cl is not None:
541 cl = int(cl)
542 if cl >= 0:
543 return cl
544 except Exception:
545 pass
546 try:
547 s = getattr(file_storage, "stream", None)
548 if s is None:
549 return None
550 pos = None
551 try:
552 pos = s.tell()
553 except Exception:
554 pos = None
555 try:
556 s.seek(0, os.SEEK_END)
557 size = int(s.tell())
558 finally:
559 try:
560 if pos is None:
561 s.seek(0)
562 else:
563 s.seek(pos)
564 except Exception:
565 pass
566 return size
567 except Exception:
568 return None
569

Callers 2

_dm_store_voiceFunction · 0.70
_group_store_voiceFunction · 0.70

Calls 1

startMethod · 0.45

Tested by

no test coverage detected