@indra.ai/deva 1.6.52 → 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 +10 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -796,7 +796,7 @@ class Deva {
|
|
|
796
796
|
created: Date.now(), // set the created date for the answer
|
|
797
797
|
};
|
|
798
798
|
// create a hash for the answer and insert into answer meta.
|
|
799
|
-
packet_answer.md5 = this.lib.hash(packet_answer);
|
|
799
|
+
packet_answer.md5 = this.lib.hash(packet_answer, 'md5');
|
|
800
800
|
packet_answer.sha256 = this.lib.hash(packet_answer, 'sha256');
|
|
801
801
|
packet_answer.sha512 = this.lib.hash(packet_answer, 'sha512');
|
|
802
802
|
|
|
@@ -873,17 +873,20 @@ 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;
|
|
886
|
-
|
|
887
|
+
|
|
888
|
+
// create new hashes for the packet before return.
|
|
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');
|
|
889
892
|
|