@indra.ai/deva 1.6.53 → 1.6.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -873,16 +873,19 @@ class Deva {
|
|
|
873
873
|
packet_answer.text = result;
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
packet_answer.md5 = this.lib.hash(packet_answer, 'md5');
|
|
877
|
-
packet_answer.sha256 = this.lib.hash(packet_answer, 'sha256');
|
|
878
|
-
packet_answer.sha512 = this.lib.hash(packet_answer, 'sha512');
|
|
876
|
+
packet_answer.md5 = this.lib.hash(packet_answer, 'md5'); // md5 the answer.
|
|
877
|
+
packet_answer.sha256 = this.lib.hash(packet_answer, 'sha256'); // sha256 the answer.
|
|
878
|
+
packet_answer.sha512 = this.lib.hash(packet_answer, 'sha512'); // sha512 the answer
|
|
879
879
|
|
|
880
|
-
packet.q.agent = agent;
|
|
881
|
-
packet.a = packet_answer;
|
|
880
|
+
packet.q.agent = agent; // set the question agent as the ask agent.
|
|
881
|
+
packet.a = packet_answer; // set the packet answer.
|
|
882
882
|
|
|
883
|
+
// delete previous hashes before creating new ones.
|
|
883
884
|
delete packet.md5;
|
|
884
885
|
delete packet.sha256;
|
|
885
886
|
delete packet.sha512;
|
|
887
|
+
|
|
888
|
+
// create new hashes for the packet before return.
|
|
886
889
|
packet.md5 = this.lib.hash(packet, 'md5');
|
|
887
890
|
packet.sha256 = this.lib.hash(packet, 'sha256');
|
|
888
891
|
packet.sha512 = this.lib.hash(packet, 'sha512');
|