UNPKG

@hclsoftware/secagent

Version:

IAST agent

30 lines (24 loc) 920 B
//IASTIGNORE /* * **************************************************** * Licensed Materials - Property of HCL. * (c) Copyright HCL Technologies Ltd. 2017, 2025. * Note to U.S. Government Users *Restricted Rights. * **************************************************** */ 'use strict' function TimedHash (timestamp, intHash) { this.timestamp = timestamp this.hashValue = intHash // return true if the given timestamp is before the instance timestamp, or when it is null this.isBefore = function (timestamp) { if (timestamp === undefined) { return true } return this.timestamp.getTime() < timestamp.getTime() } // return true if the given timestamp is after the instance timestamp, or when it is null this.isAfter = function (timestamp) { if (timestamp === undefined) { return true } return this.timestamp.getTime() > timestamp.getTime() } } module.exports.TimedHash = TimedHash