Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

checksumdir

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checksumdir

Compute a single hash of the file contents of a directory.

  • 1.2.0
  • PyPI
  • Socket score

Maintainers
1

Checksumdir


|badge1| |badge2|

.. |badge1| image:: https://img.shields.io/pypi/dm/checksumdir
:alt: PyPI - Downloads :target: https://pypi.org/project/checksumdir/

.. |badge2| image:: https://badge.fury.io/py/checksumdir.svg :target: https://pypi.org/project/checksumdir/

A simple module for creating a single hash for a directory of files, with file contents; ignoring any metadata such as file name. Options exist to also exclude specific files or files with specific extensions.

===== Usage

.. code-block:: python

from checksumdir import dirhash

directory  = '/path/to/directory/'
md5hash    = dirhash(directory, 'md5')
sha1hash   = dirhash(directory, 'sha1', excluded_files=['package.json'])
sha256hash = dirhash(directory, 'sha256', excluded_extensions=['pyc'])

Or to use the CLI:

.. code-block:: bash

# Defaults to md5.
$ checksumdir /path/to/directory

# Create sha1 hash:
$ checksumdir -a sha1 /path/to/directory

# Exclude files:
$ checksumdir -e <files> /path/to/directory

# Exclude files with specific extensions:
$ checksumdir -x <extensions> /path/to/directory

# Follow soft links:
$ checksumdir --follow-links /path/to/directory

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc