Results 1 to 4 of 4

Thread: ora_hash

  1. #1
    Join Date
    Jul 2011
    Posts
    2

    Unanswered: ora_hash

    Which algorithm ora_hash uses to calculate hash?

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I'm not sure that you'll find that information published in public. You might ask Oracle (I'm not sure they'll tell it either). This algorithm is considered to be confidential, so - even if they tell you, they'd have to kill you.

    Just kidding, of course.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    It really doesn't matter. The algorithm used is non reversible. It used to be able to be busted via brute force before Oracle 10 but they rewrote it then and no one has cracked it.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jul 2011
    Posts
    2
    I don't want to crack it. I need to implement the same algorithm in Java. Java hash function doesn't return the same hash code for the same input and that's the problem I have.

    I don't get it why is it confidential, for example Java hash function calculates hash for String object as

    s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]

    I don't know much about PL/SQL, so let me ask other question, is it possible to tune up max_bucket and/or seed_value parameters of ora_hash function to get the same hash code as Java hash function returns? Probably it is not possible because algorithms used to calculate hash code are different.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •