@sei-js/cosmjs
Version:
TypeScript library for CosmJS interactions on the Sei blockchain
11 lines (10 loc) • 322 B
JavaScript
import { sha256 as Sha256Hash } from 'sha.js';
/**
* Returns the sha256 encoded hash of the given data.
* @param data The data to encode.
* @returns The sha256 encoded hash of the given data.
* @category Utils
*/
export const sha256 = (data) => {
return new Uint8Array(new Sha256Hash().update(data).digest());
};