Generate Subject Hash of X509Certificate in Java

This generates a short 8 digit hash 1817886a There are two forms of this from OpenSSL: $ cd openssl-1.0.2-src $ grep -R X509_subject_name_hash * … crypto/x509/x509.h:unsigned long X509_subject_name_hash(X509 *x); crypto/x509/x509.h:unsigned long X509_subject_name_hash_old(X509 *x); crypto/x509/x509_cmp.c:unsigned long X509_subject_name_hash(X509 *x) crypto/x509/x509_cmp.c:unsigned long X509_subject_name_hash_old(X509 *x) … Generate Subject Hash of X509Certificate in Java… Here is the source for them … Read more

Good hashCode() Implementation

The value is not important, it can be whatever you want. Prime numbers will result in a better distribution of the hashCode values therefore they are preferred. You do not necessary have to add them, you are free to implement whatever algorithm you want, as long as it fulfills the hashCode contract: Whenever it is … Read more

SHA1 hashing in SQLite: how?

There is no such function built into SQLite3. But you could define a user function e.g. with sqlite3_create_function if you’re using the C interface, and implement SHA-1 with that. (But if you’re having a programmable interface perhaps you could just SHA-1 the password outside of the SQL engine.) You could also try to find / … Read more