folderHashSync

Type:Function
Status:stable
Since:1.0.0
Platform:node
@blackbyte.sugar.node.fs

This function allows you to get back an integrity hash for the passed folder. This mean that if a folder returns the same integrity hash twice, the folder or files in it has not been updated…

Params

  1. folderPath*-String

    The folder path you want to get the hash back

  2. settings{}TFolderHashSettings

    Some settings to configure your hash generation process

Return

  1. -String

    The calculated folder hash

Example

import { folderHashSync } from '@blackbyte/sugar/fs';
folderHashSync('my/cool/folder'); // => YZOrKDx9LCLd8X39PoFTflXGpRU=,

Settings

  1. recursivetrueBoolean

    Specify if you want to generate a hash using also the children or not

  2. algo’sha356’String

    The algorithm to use

  3. digest’base64’BinaryToTextEncoding

    How to digest the hash