TinyBase logoTinyBase β

getValueInValuesHash

The getValueInValuesHash function returns a hash for a single Value in a Values object, based on its Id and hash (in turn produced from its value).

getValueInValuesHash(
  valueId: string,
  valueHash: number,
): Hash
TypeDescription
valueIdstring

The Id of the Value.

valueHashnumber

The hash of the Value.

returnsHash

A hash of the Value based on its content and Id.

Example

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

import {getValueInValuesHash} from 'tinybase';

const valueId = 'meaningOfLife';
const valueHash = 312420374; // hash of 42 and '03E3B------mmxrx'

console.log(getValueInValuesHash(valueId, valueHash));
// -> 330198963

Since

v6.2.0