TinyBase logoTinyBase β

getTableInTablesHash

The getTableInTablesHash function returns a hash for a single Table in a Store, based on its Id and hash (in turn produced from its Rows).

getTableInTablesHash(
  tableId: string,
  tableHash: number,
): Hash
TypeDescription
tableIdstring

The Id of the Table.

tableHashnumber

The hash of the Table.

returnsHash

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

Example

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

import {getTableInTablesHash} from 'tinybase';

const tableId = 'pets';
const tableHash = 4262151841; // hash of its contents

console.log(getTableInTablesHash(tableId, tableHash));
// -> 278115833

Since

v6.2.0