md5-node-cg-lib

0.0.10 • Public • Published

N|Solid

md5-node-cg-lib

The library can be downloaded from the following url: https://github.com/CloudGenUser/md5-node-cg-lib.git The downloaded must be Imported to the Project that is intended to be used

1. Introduction

This library allows generating an MD5 ID that can be used to identify and ensure if two objects are the same. With this validation the user can be sure of the integrity of the information that flows.

2. Library usage

The library can be installed from npm page with the next:

npm install md5-node-cg-lib, npm i md5-node-cg-lib or yarn install md5-node-cg-lib

2.1 Library Methods

Method getMd5ID

This method creates the "crypto" module that provides cryptographic functionality that includes a set of wrappers for OpenSSL hashing, HMAC, recording, decryption, signing, and verification functions. The algorithm depends on the available algorithms supported by the version of OpenSSL on the platform. Compute the digest of all passed data to be encrypted (using the hash.update() method)

3. Example

  1. VALIDATE OBJECTS

Validate the objects are correct

  1. GET LOCATION OF OBJECT

Get the path of Object

  1. RUN THE APP MD5

Run the app in development IDE.

  1. VALIDATE THE RUN IN THE LOG Validates in the log if the object was transformed through a message in the console where it shows the encryption of the String.
const getMd5ID = (content) => {
    try {
        return crypto.createHash('md5').update(content).digest("hex");
    } catch (error) {
        log.error(`Error Creating MD5 id: ${error}`);
        throw Error(error);
    }
}

The Result is:

Result MD5 id: d501194c987486789bb01b50dc1a0adb

Package Sidebar

Install

npm i md5-node-cg-lib

Weekly Downloads

46

Version

0.0.10

License

ISC

Unpacked Size

21.2 kB

Total Files

8

Last publish

Collaborators

  • cloudgenuser