The Artima Developer Community
Sponsored Link

Java Answers Forum
Conversion to java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jeffrie Joshua Lazarus George

Posts: 7
Nickname: jeffriejos
Registered: Jan, 2010

Conversion to java Posted: Feb 4, 2011 1:45 AM
Reply to this message Reply
Advertisement
How to convert this to Java???????

/*
* Input is in hex format - trailing odd nibble gets a zero appended.
*/
function hex2blks_SHA1(hex)
{
var len = (hex.length + 1) >> 1;
var nblk = ((len + 8) >> 6) + 1;
var blks = new Array(nblk * 16);
for(var i = 0; i < nblk * 16; i++) blks = 0;
for(i = 0; i < len; i++)
blks[i >> 2] |= parseInt(hex.substr(2*i, 2), 16) << (24 - (i % 4) * 8);
blks[i >> 2] |= 0x80 << (24 - (i % 4) * 8);
blks[nblk * 16 - 1] = len * 8;
return blks;
}

Topic: online survey on Agile concepts in software development and its perception Previous Topic   Next Topic Topic: java programming

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use