import { validate , v5 } from 'uuid' ; import { deepSortObject } from './deep-sort-object' ; param namespaceId param dataToHash returns export function getHashedIdForInput < T > ( namespaceId , dataToHash ) { if ( ! validate ( namespaceId ) ) { throw new Error ( 'Workspace id must be an uuid' ) ; } const sortedObj = deepSortObject ( dataToHash ) ; const stringifiedData = JSON . stringify ( sortedObj ) ; return v5 ( stringifiedData , namespaceId ) ; }