Skip to content

Hash

This module allows you to generate hash compatible with the system. The algorithm used is the SHA-256.

Usage

The module has a couple op functions to generate hash from string or file

fromString

const { Hash } = require("@bcode-tech/bcode-sdk");

const textToHash = "your-text";

const hash = Hash.fromString(textToHash);

fromBuffer

const { Hash } = require("@bcode-tech/bcode-sdk");

const file = fs.readFileSync("path-to-your-file");

const hash = Hash.fromBuffer(file);