How to use the @hpcc-js/util.hashSum function in @hpcc-js/util

To help you get started, we’ve selected a few @hpcc-js/util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hpcc-systems / Visualization / packages / eclwatch / src / WUStatus.ts View on Github external
attachWorkunit() {
        const hash = hashSum({
            baseUrl: this.baseUrl(),
            wuid: this.wuid()
        });
        if (this._prevHash !== hash) {
            this._prevHash = hash;
            this._wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
            if (this._wuHandle) {
                this._wuHandle.release();
            }
            this._wuHandle = this._wu.watch(changes => {
                this.lazyRender();
            });
        }
    }
github hpcc-systems / Visualization / packages / marshaller / src / ddl2 / activities / sort.ts View on Github external
hash(): string {
        return hashSum({
            Sort: this.column().map(sb => sb.hash())
        });
    }
github hpcc-systems / HPCC-Platform / esp / src / src / GraphTree7Widget.ts View on Github external
fetchScopeGraph(wuid: string, graphID: string, subgraphID: string = "", refresh: boolean = false): Promise {
        this.graphStatus.innerText = this.i18n.FetchingData;
        const hash = hashSum({
            wuid,
            graphID,
            subgraphID
        });
        if (!this._prevScopeGraph || refresh || this._prevHashSum !== hash) {
            this._prevHashSum = hash;
            this._gc.clear();
            const wu = Workunit.attach({ baseUrl: "" }, wuid);
            this._prevScopeGraph = wu.fetchGraphs().then(graphs => {
                for (const graph of graphs) {
                    if (graph.Name === graphID) {
                        return graph.fetchScopeGraph(subgraphID).then(scopedGraph => {
                            this.graphStatus.innerText = this.i18n.Loading;
                            return new Promise((resolve, reject) => {
                                setTimeout(() => {
                                    this._gc.set(scopedGraph);
github hpcc-systems / Visualization / packages / eclwatch / src / WUTimeline.ts View on Github external
fetchScopes() {
        const hash = hashSum({
            baseUrl: this.baseUrl(),
            wuid: this.wuid(),
            request: this.request()
        });
        if (this._prevHashSum !== hash) {
            this._prevHashSum = hash;
            const wu = Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid());
            wu.fetchDetails(this.request()).then(scopes => {
                return scopes.filter(scope => scope.Id && scope.attr("WhenStarted").RawValue).map((scope: Scope) => {
                    const whenStarted = +scope.attr("WhenStarted").RawValue / 1000;
                    const timeElapsed = +scope.attr("TimeElapsed").RawValue / 1000000;
                    return [
                        scope.Id,
                        new Date(whenStarted).toISOString(),
                        timeElapsed ? new Date(whenStarted + timeElapsed).toISOString() : undefined,
                        null,
github hpcc-systems / HPCC-Platform / esp / src / src / Graph7Widget.ts View on Github external
fetchScopeGraph(wuid: string, graphID: string, refresh: boolean = false): Promise {
        this.graphStatus.innerText = this.i18n.FetchingData;
        const hash = hashSum({
            wuid,
            graphID
        });
        if (!this._prevScopeGraph || refresh || this._prevHashSum !== hash) {
            this._prevHashSum = hash;
            this._gc.clear();
            const wu = Workunit.attach({ baseUrl: "" }, wuid);
            this._prevScopeGraph = wu.fetchScopeGraphs(graphID ? [graphID] : []).then(scopedGraph => {
                this.graphStatus.innerText = this.i18n.Loading;
                return new Promise((resolve, reject) => {
                    setTimeout(() => {
                        this._gc.set(scopedGraph);
                        resolve(scopedGraph);
                    }, 0);
                });
            });
github hpcc-systems / Visualization / packages / marshaller / src / ddl2 / activities / project.ts View on Github external
hash(): string {
        return hashSum({
            computedFields: this.computedFields().map(cf => cf.hash()),
        });
    }