|
@@ -41,7 +41,7 @@ output_hex(ostream &out) const {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: HashVal::input
|
|
|
|
|
|
|
+// Function: HashVal::input_hex
|
|
|
// Access: Published
|
|
// Access: Published
|
|
|
// Description: Inputs the HashVal as a 32-digit hexadecimal number.
|
|
// Description: Inputs the HashVal as a 32-digit hexadecimal number.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
@@ -77,6 +77,38 @@ input_hex(istream &in) {
|
|
|
decode_hex(buffer + 24, _hv[3]);
|
|
decode_hex(buffer + 24, _hv[3]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: HashVal::output_binary
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Outputs the HashVal as a binary stream of bytes in
|
|
|
|
|
+// order. This is not the same order generated by
|
|
|
|
|
+// write_stream().
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void HashVal::
|
|
|
|
|
+output_binary(ostream &out) const {
|
|
|
|
|
+ StreamWriter writer(out);
|
|
|
|
|
+ writer.add_be_uint32(_hv[0]);
|
|
|
|
|
+ writer.add_be_uint32(_hv[1]);
|
|
|
|
|
+ writer.add_be_uint32(_hv[2]);
|
|
|
|
|
+ writer.add_be_uint32(_hv[3]);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: HashVal::input_binary
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Inputs the HashVal as a binary stream of bytes in
|
|
|
|
|
+// order. This is not the same order expected by
|
|
|
|
|
+// read_stream().
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void HashVal::
|
|
|
|
|
+input_binary(istream &in) {
|
|
|
|
|
+ StreamReader reader(in);
|
|
|
|
|
+ _hv[0] = reader.get_be_uint32();
|
|
|
|
|
+ _hv[1] = reader.get_be_uint32();
|
|
|
|
|
+ _hv[2] = reader.get_be_uint32();
|
|
|
|
|
+ _hv[3] = reader.get_be_uint32();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: HashVal::as_dec
|
|
// Function: HashVal::as_dec
|
|
|
// Access: Published
|
|
// Access: Published
|