TinyBase logoTinyBase β

getValueHash

The getValueHash function returns a hash for a single Value, based on its value and the HLC of the Value.

getValueHash(
  value: ValueOrUndefined,
  valueHlc: string,
): Hash
TypeDescription
valueValueOrUndefined

The Value (or undefined).

valueHlcstring

The HLC of the Value.

returnsHash

A hash of the Value.

Example

This example gets the hash of a Value and its HLC.

import {getValueHash} from 'tinybase';

const value = 42;
const valueHlc = '03E3B------mmxrx';

console.log(getValueHash(value, valueHlc));
// -> 312420374

Since

v6.2.0