Skip to content

Latest commit

 

History

History
37 lines (33 loc) · 1.47 KB

hash.md

File metadata and controls

37 lines (33 loc) · 1.47 KB

HASH

A hash function is a mathematical algorithm that takes in input data of arbitrary size and outputs a fixed-length string of characters, known as the hash value or digest. The goal of a hash function is to produce a unique output for each unique input, so that any change in the input data results in a different hash value. Hash functions are commonly used in cryptography to ensure the integrity and authenticity of data by generating unique digital signatures, and in data structures like hash tables to index and retrieve data.

There are various hash functions available, with different properties such as speed, security, and output size. Some of the most commonly used hash functions are:

MD5 Encode

const data = "this.is.a.test";
const encMd5 = KsCryp.encode(data, "hash", { algorithm: "md5" });

MD5 Verify

const data = "this.is.a.test";
const encMd5 = KsCryp.verify(resr, "hash", { key: data, algorithm: "md5" });

SHA256 Encode

const data = "this.is.a.test";
const encMd5 = KsCryp.encode(data, "hash", { algorithm: "sha256" });

SHA256 Verify

const data = "this.is.a.test";
const encMd5 = KsCryp.verify(resr, "hash", { key: data, algorithm: "sha256" });

SHA512 Encode

const data = "this.is.a.test";
const encMd5 = KsCryp.encode(data, "hash", { algorithm: "sha512" });

SHA512 Verify

const data = "this.is.a.test";
const encMd5 = KsCryp.verify(resr, "hash", { key: data, algorithm: "sha512" });