Re: [MarkLogic Dev General] Fwd: xdmp:hash32 and xdmp:hash64 algorithm

2015-08-06 Thread sweet frd
Hi,

Referred the websites below

http://stackoverflow.com/questions/25457943/xdmphash64-equivalent-in-java
http://iswwwup.com/t/d920b2cb9d40/xdmp-hash64-equivalent-in-java.html

As suggested gone for the SHA / MD5 algorithms in java which has its
equivalent below APIs in xquery.

   - xdmp:hmac-md5 <https://docs.marklogic.com/xdmp:hmac-md5>
   - xdmp:hmac-sha1 <https://docs.marklogic.com/xdmp:hmac-sha1>
   - xdmp:hmac-sha256 <https://docs.marklogic.com/xdmp:hmac-sha256>
   - xdmp:hmac-sha512 <https://docs.marklogic.com/xdmp:hmac-sha512>


Thanks,

Sumathi.


On Wed, Aug 5, 2015 at 11:40 AM, Paul Hoehne 
wrote:

> MD5 and SHA1 are standardized and available in Java.  Generally you will
> need to convert the binary hash value (returned in Java as bytes) to a
> hexidecimal number.  Make suer you generate the same number on bot the
> XQuery and Java side of the equation.  Make sure you add leading zeros and
> make sure you use the same case, so you don’t accidentally generate
> ‘03b7d405’ on one server and ‘3B7D45’ on the other.
>
> *Paul Hoehne*
> Senior Consultant
> MarkLogic Corporation
> paul.hoe...@marklogic.com
> mobile:* +1 571-992-8869 <%2B1%20571-992-8869>*
> www.marklogic.com
>
> Click http://po.st/hMGDFm to get your free NoSQL For Dummies e-book!
>
> From: Raghu 
> Reply-To: MarkLogic Developer Discussion 
> Date: Wednesday, August 5, 2015 at 11:15 AM
> To: MarkLogic Developer Discussion 
> Subject: Re: [MarkLogic Dev General] Fwd: xdmp:hash32 and xdmp:hash64
> algorithm
>
> Hi all,
>
> To add to that question, I have a requirement, I have to hash certain
> value at xquery end and the same value has to be hashed/unhashed at Java
> end. Is there a hashing function in Marklogic which exactly matches with
> Java hash implementation?
>
> Thanks in advance!
> Raghu
>
> On Wed, Aug 5, 2015 at 10:49 AM, sweet frd 
> wrote:
>
>>
>> Hi,
>>
>>  The xdmp hash APIs are using which algorithm?. how it is converting
>> the string to unsignedInt? on which basis?
>>
>> Thanks in Advance
>> Sumathi.
>>
>>
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>
>>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Fwd: xdmp:hash32 and xdmp:hash64 algorithm

2015-08-05 Thread Paul Hoehne
MD5 and SHA1 are standardized and available in Java.  Generally you will need 
to convert the binary hash value (returned in Java as bytes) to a hexidecimal 
number.  Make suer you generate the same number on bot the XQuery and Java side 
of the equation.  Make sure you add leading zeros and make sure you use the 
same case, so you don’t accidentally generate ‘03b7d405’ on one server and 
‘3B7D45’ on the other.

Paul Hoehne
Senior Consultant
MarkLogic Corporation
paul.hoe...@marklogic.com
mobile: +1 571-992-8869
www.marklogic.com

Click http://po.st/hMGDFm to get your free NoSQL For Dummies e-book!

From: Raghu 
mailto:raghupathy.visweswa...@gmail.com>>
Reply-To: MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Date: Wednesday, August 5, 2015 at 11:15 AM
To: MarkLogic Developer Discussion 
mailto:general@developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] Fwd: xdmp:hash32 and xdmp:hash64 algorithm

Hi all,

To add to that question, I have a requirement, I have to hash certain value at 
xquery end and the same value has to be hashed/unhashed at Java end. Is there a 
hashing function in Marklogic which exactly matches with Java hash 
implementation?

Thanks in advance!
Raghu

On Wed, Aug 5, 2015 at 10:49 AM, sweet frd 
mailto:sumathisumi...@gmail.com>> wrote:

Hi,

 The xdmp hash APIs are using which algorithm?. how it is converting the 
string to unsignedInt? on which basis?

Thanks in Advance
Sumathi.


___
General mailing list
General@developer.marklogic.com<mailto:General@developer.marklogic.com>
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general


___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Fwd: xdmp:hash32 and xdmp:hash64 algorithm

2015-08-05 Thread Raghu
Hi all,

To add to that question, I have a requirement, I have to hash certain value
at xquery end and the same value has to be hashed/unhashed at Java end. Is
there a hashing function in Marklogic which exactly matches with Java hash
implementation?

Thanks in advance!
Raghu

On Wed, Aug 5, 2015 at 10:49 AM, sweet frd  wrote:

>
> Hi,
>
>  The xdmp hash APIs are using which algorithm?. how it is converting
> the string to unsignedInt? on which basis?
>
> Thanks in Advance
> Sumathi.
>
>
> ___
> General mailing list
> General@developer.marklogic.com
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general


[MarkLogic Dev General] Fwd: xdmp:hash32 and xdmp:hash64 algorithm

2015-08-05 Thread sweet frd
Hi,

 The xdmp hash APIs are using which algorithm?. how it is converting
the string to unsignedInt? on which basis?

Thanks in Advance
Sumathi.
___
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general