-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[names] Remove PHP serialization and hashing for Web service cache #18
Comments
Here is an example of how queries are currently hashed:
|
In PHP the hashing happens as follows sha1(serialize("Taraxacum officinale")) The Java equivalent for this is String s = Pherialize.serialize("Taraxacum officinale");
try {
// create MD5 Hash
MessageDigest digest = MessageDigest.getInstance("SHA-1");
digest.update(s.getBytes());
// create Hex String for comparision with existing PHP SHA1 hashes
StringBuilder hexString = new StringBuilder();
for (byte b : digest.digest()) hexString.append(String.format("%02X", 0xFF & b));
// existing query hashes are also in lower case
s = hexString.toString().toLowerCase();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} where Pherialize is only used to (de-)serialize Strings as in PHP. |
Web service responses are also currently serialized as in PHP and not in plain text. In order to fully remove the need for PHP (de-)serialization the existing OpenUp! Web service cache table has to be adjusted. |
PHP (de-)serialization for results could temporarily be moved to the |
The Web service cache is as implemented from #15 is currently using PHP string serialization and SHA1 hashing for using hexadecimal strings in order to query cached responses from the currently active OpenUp! project.
This serialization and hashing is to be either removed or improved for language independent use.
The text was updated successfully, but these errors were encountered: