Skip to content

add tests#166

Open
shay-te wants to merge 2 commits into
masterfrom
add-tests
Open

add tests#166
shay-te wants to merge 2 commits into
masterfrom
add-tests

Conversation

@shay-te

@shay-te shay-te commented Apr 22, 2026

Copy link
Copy Markdown
Owner

No description provided.

Comment thread core_lib/helpers/files.py

def get_file_md5(file_name: str) -> str:
hasher = hashlib.md5()
hasher = hashlib.md5(usedforsecurity=False)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shubham-shay-te please verify this change

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chat says to use

def get_file_sha256(file_name: str) -> str:
    hasher = hashlib.sha256()
    with open(file_name, 'rb') as f:
        for chunk in iter(lambda: f.read(8192), b''):
            hasher.update(chunk)
    return hasher.hexdigest()

sha256 instead

md5 is not secure it is okay for only checking but not reliable as it has vulnerabilities

also he tells to add chunking if it is big file the process will crash

@sonarqubecloud

Copy link
Copy Markdown

Comment thread core_lib/helpers/files.py

def get_file_md5(file_name: str) -> str:
hasher = hashlib.md5()
hasher = hashlib.md5(usedforsecurity=False)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chat says to use

def get_file_sha256(file_name: str) -> str:
    hasher = hashlib.sha256()
    with open(file_name, 'rb') as f:
        for chunk in iter(lambda: f.read(8192), b''):
            hasher.update(chunk)
    return hasher.hexdigest()

sha256 instead

md5 is not secure it is okay for only checking but not reliable as it has vulnerabilities

also he tells to add chunking if it is big file the process will crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants