Nukem's Possible Manifestation

    rev-hash
    TypeScript icon, indicating that this package has built-in type declarations

    4.0.0 • Public • Published

    rev-hash

    Create a hash for file revving

    It will create an md5 hash from an input buffer or string, and truncate it to 10 characters, which is unique enough for this purpose.

    If you think you need a different hash algorithm or a longer hash, you're wrong.

    Install

    npm install rev-hash

    Usage

    import fs from 'node:fs';
    import revisionHash from 'rev-hash';
    
    revisionHash(fs.readFileSync('unicorn.png'));
    //=> 'bb9d8fe615'
    
    revisionHash('Lorem ipsum dolor sit amet');
    //=> 'fea80f2db0'

    API

    revisionHash(input)

    input

    Type: Buffer | string

    The data to create a hash from.

    Install

    npm i rev-hash

    DownloadsWeekly Downloads

    115,732

    Version

    4.0.0

    License

    MIT

    Unpacked Size

    3.3 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus