Hash() in coldfusion equivalent in java

Hi,
I have a hash function in coldfusion which i want to implement in java. The coldfusion hash function in my case DOES NOT take any algorithm as a parameter. In java I have seen that to use message digest we have to specify an algorithm. Can it be done without any algorithm specified ?
Here is the documentation of the coldfusion hash() function:
http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000503.htm#1105551
Thanks

theLeonidas wrote:
I have a hash function in coldfusion which i want to implement in java. The coldfusion hash function in my case DOES NOT take any algorithm as a parameter. Then you need to find out which algorithm is used for your function.
In java I have seen that to use message digest we have to specify an algorithm.
Can it be done without any algorithm specified ?Just because you don't need to specify one in 'cold fusion' does not mean that one of the standard algorithms is not being used. It should be easy enough to find out which one is being used - in Java, just try all those listed in the document you referenced below and compare the result with your coldfusion result.
>
Here is the documentation of the coldfusion hash() function:
http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000503.htm#1105551
P.S. I bet your function uses the MD5 hash.

Similar Messages

  • Equivalent of java.sql.ResultSetMetaData

    Hi,
    I'm looking for something which is equivalent to java.sql.ResultSetMetaData in Toplink. Does anyone know how this can be done ?
    Thanks,
    -Prashant

    Hi,
    I have a similar problem. I want to find out the column names when i fire raw-sql. I use SQLCall to do this.
    Then I get a Vector<DatabaseRow>.
    Vector vDR = session.executeQuery( new SQLCall( "select * from table_name" ) )
    Now Is there a way to find out the column names dynamically. In the javadocs i see that objDatabaseRow.keys() returns an Enum<DatabaseField>... but i cant see javadocs on how to use DatabaseField.
    So is there any other way ?
    Thanks,
    Krishna

  • Can we define a complex type that is equivalent to java.util.List?

    hi everyone
    is it possible to define a complexType that is equivalent to java.util.List? all i know now is how to define an array of some type using either <xs:list> for simpleType or the minOccurs and maxOccurs of the element tag. i was wondering if there is way to define something equivalent to a List in java. thanks

    Define a sequence of list tems.
    <xs:element name="list">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="item"  maxOccurs="unbounded"  type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>

  • ReDim equivalent in Java

    Hello,
    What's the equivalent in Java of 'Redim '?
    e.g Redim RedBucket(0)(0)
    is it an ArrayList
    Thanks
    Paul

    ReDim is like ArrayList in the same way that a wheelbarrow is like a pickup truck.
    With ReDim, you have to specify the size of the array at the beginning, and then you have to decide when the size needs to be changed, and you have to decide what to change it to. With ArrayList, you don't have to do any of that. You just say "Gimme an ArrayList" and it figures out how much array space it needs by itself.
    But really, you're better off just learning Java. You won't want to speak Java with a VB accent.

  • APEX equivalent of Java Static Initialization Block

    Is there a APEX equivalent of Java static init block (i.e. execute once at class load time)? My use case is that I need to load some configuration values to an environment (i.e. APEX Workspace) specific variables and don't want to do per user session since the values remain the same for all user sessions. I believe SYS_CONTEXT is tied to user session and would not be useful for my usecase. Any advise would be appreciated.

    Hello,
    You should check the concept of User Preferences and see if it can help you:
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21678/aadm_mg_sessions.htm#BABHFEFD
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • ColdFusion 9, 10 Java 7 Support ASAP!

    Oracle has released the final Java 6 Update 39 last week, marking the end of support for Java 6.  Adobe has stated multiple times that Java 7 would be supported before EOL, yet it has been a week and still no patches or update.  Does anyone have an ETA when Java 7 will be officially supported?
    References:
    Java version support     [http://forums.adobe.com/thread/975438 | http://forums.adobe.com/thread/975438]
    Java 7 support for ColdFusion    
    http://blogs.coldfusion.com/post.cfm/java-7-support-for-coldfusion
    What's the situation with #ColdFusion and Java 7, Java 6 updates, Windows 8, and OS X Mountain Lion?          [http://www.carehart.org/blog/client/index.cfm/2012/12/12/java_7_and_6_updates_and_Win8_and _MtnLion | http://www.carehart.org/blog/client/index.cfm/2012/12/12/java_7_and_6_updates_and_Win8_and _MtnLion]
    Upgrade Java for ColdFusion  http://helpx.adobe.com/coldfusion/kb/upgrading-java-coldfusion.html

    Has Adobe updated all current Java and ColdFusion KB articles yet, so I don't have to assume that when Java 7 Update 16 is released that we can apply it assuming we have the base Adobe patches that support Java ?.  I also have seen some confusing articles about JDK vs JRE, for example Ben Forta's blog post yesterday Upgrading ColdFusion To Java 7 at http://forta.com/blog/index.cfm/2013/3/3/Upgrading-ColdFusion-To-Java-7
    Ben, the Adobe website states JDK is required, not JRE "Download and install JDK 1.7." http://helpx.adobe.com/coldfusion/kb/coldfusion-10-update-8.html and "Note that ColdFusion requires the Java HotSpot Server virtual machine (jre/bin/server/jvm.dll), which is not available with the JRE download." http://helpx.adobe.com/coldfusion/kb/change-coldfusion-jvm.html
    PS +10 to Carl's question "Will CF9 or CF10 be supported on JDK 8? JDK 8 release expected September 2013?", I would like Adobe to state ColdFusion upgrade plans and timetables for new versions of Java.  Java 7 was released over 18 months ago and Java 6 received several end of life extension both without Adobe updating ColdFusion untl the last possible second!

  • $ENV perl equivalent in Java

    We are in our first steps in trying to convert some of our systems from Perl to Java.
    In a module we had (Database module) which was responsible for all DB activity, we had an area where, upon errors, we printed out $ENV{SCRIPT_NAME} environment variable, which is set by Apache and can be read by Perl. This helps us debug things by knowing which script was ran when a DB error occurred.
    As we are porting the Database module into a Database class, we are trying to think how we can achieve the same capability with Java.
    I don't know of the existence of $ENV equivalent in Java. Not one that contains the web-server executed script, in case its a script that is ran by a web server.
    Is there?
    Note that the Database module may be ran as part of a Servelet but may also be part of just a simple server script. In perl, is such case, the $ENV{SCRIPT_NAME} would come out empty.
    Any suggestions of how to do that?

    Pidgin wrote:
    As you indicated: Note that both are relatively slow and should only be used for exceptional or error conditions.
    The access to the SCRIPT_NAME is actually a web re,ated variable that we need for showing which HTTP resquest generated the specific SQL error.It's only a variable in perl (or in CGI scripts, to be more precise).
    It happens often enough, and doing a very low-level trace of the executed code migt not be the right option.SQLExceptions that need logging happen often? That shouldn't be the fact. How often?
    Stacktraces are not awfully slow. They are ok for handling errors & exceptions. But they should not be used for classical flow control.
    For example, it might be that the executing code is Script.class using Database.class, but Script.class can be initiated from www.whatever.com/script/ or www.whatever.com/premium/script/.. in each case, we want to know the full URL of the called "script'.With the stack trace you'd see the Servlet and/or Action that handles the request.
    So we do need access to the web "environment".
    What we do now, is store a static Servlet_Request variable (set on the first Database constructor, by passing the servlet request and response objects to the Database constructor). From that point on, we can access Servlet_Request.getRequestURI()That won't work as soon as more than one request is handled at the same time (which is very, very soon!).
    You might want to look into something like log4js MDC, where you can at one point in your application set a key in a map and have that appear in every log statement from that thread until it's removed again.
    This is quite different than the Perl logic, where we could access a "web enabled" System.getenv() and read from it SCRIPT_NAME or other web related parameters, if they existed (or returning null if they didn't)You should not try to apply the best practices learned by perl web programming 1:1 on Java. In the Java world pretty different concepts apply, especially when doing Web-Programming, as Perl web-applications are usually based on the rather antiquated CGI interface, while Java uses a central application server that handles each request as it wishes.

  • Forte Express Equivalent in Java

    Hi
    Can any body tell me Forte Express equivalent in Java?
    Thanks in advance

    Hi
    Can any body tell me Forte Express equivalent in Java?
    Thanks in advance

  • Struct equivalent for java array?

    What's the struct (c++) equivalent in Java?
    here's my im doing.
    class Text
    char character;
    int freq;
    public static void main(String[] args) throws IOException
    BufferedReader key = new BufferedReader(new InputStreamReader(System.in));
    Text[] letter = new Text[2];
    I want to assgined letter[0].character = 'a'; and letter[0].freq = '3' but it doesn't allow me to do that when I compile it?

    I've trying doing:
    for(i = 0; i < letter.length; i++)
                   letter.character = new Text();
                   letter[i].freq = new Text();
    and even
    for(i = 0; i < letter.length; i++)
                   letter= new Text();
    before doing
    letter[0].character = 'a';
              letter[0].freq = '3'; but got an error:
    non static varible this cannot be referenced from a static context

  • Foreach equivalent in java

    Hi all,
    I am doing some conversion process from C# to java. I am struck with c# foreach statement.
    Here I give the coding,
    foreach (MapFieldInfo item in Fields)
    if (item == null)
    continue;
    if (item.Field.Equals(fieldInfo))
    exp = item.NewExpression;
    break;
    Here the MapFieldInfo in another class. I need the equivalent java for loop for this statement.
    Pls could anyone help me.
    Thanks in advance.
    Uma

    for (Iterator it = aCollection.getIterator(); it.hasNext();){
      MyClass myObj = (MyClass)it.next();
      // .. do stuff with myObj
    }I understand that the J2SE 1.5 spec is going to add something similar to foreach to the Java language - it's really just syntactic sugar to make the code a little less verbose, though.
    Also, you just know that there are going to be people using the new nomenclature that forget what an iterator is altogether and make silly programming decisions...
    - K

  • Wepshere and ColdFusion Mx 7- Java Hangs

    Hi folks,
    We just recently went live with our new web server and are
    experiencing occaisional hangs with Websphere/CF. IBM has diagnosed
    the following, and I am hoping you might be able to help shed
    further light on how we might correct or alleviate the problem.
    I see out of memory exceptions and the current thread is deep
    in ColdFusion code...
    Current Thread Details
    "WebContainer : 19" (TID:0x30785DD8,
    sys_thread_t:0x4B70F1A0, state:R, native ID:0x4DF4) prio=5
    at
    coldfusion.runtime.NeoBodyContent.getString(NeoBodyContent.java(Compiled
    Code))
    at
    coldfusion.tagext.lang.ThistagScope.setBodyContent(ThistagScope.java(Compiled
    Code))
    at
    coldfusion.tagext.lang.ModuleTag.doAfterBody(ModuleTag.java(Compiled
    Code))
    at
    cffbx_fusebox30_CF50_nix2ecfm97317734._factor2(fbx_fusebox30_CF50_nix.cfm:286)
    at
    cffbx_fusebox30_CF50_nix2ecfm97317734._factor4(fbx_fusebox30_CF50_nix.cfm:258)
    at
    cffbx_fusebox30_CF50_nix2ecfm97317734._factor5(fbx_fusebox30_CF50_nix.cfm:1)
    at
    cffbx_fusebox30_CF50_nix2ecfm97317734.runPage(fbx_fusebox30_CF50_nix.cfm:1)
    at
    coldfusion.runtime.CfJspPage.invoke(CfJspPage.java(Compiled Code))
    at
    coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java(Compiled
    Code))
    at
    coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java(Compiled
    Code))
    at cfindex2ecfm1859906939.runPage(index.cfm:19)
    at
    coldfusion.runtime.CfJspPage.invoke(CfJspPage.java(Compiled Code))
    at
    coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java(Compiled
    Code))
    at
    coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java(Compiled
    Code))
    at
    coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java(Compiled
    Code))
    at
    coldfusion.filter.PathFilter.invoke(PathFilter.java(Compiled Code))
    at
    coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java(Compiled
    Code))
    at
    coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java(C ompiled
    Code))
    at
    coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java(Compiled
    Code))
    at
    coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java(Compiled
    Code))
    at
    coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java(Compiled
    Code))
    at coldfusion.CfmServlet.service(CfmServlet.java(Compiled
    Code))
    at
    coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java(Compiled
    Code))
    at
    com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java(Compiled
    Code))
    at
    com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java(Compiled
    Code))
    at
    com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java(Compiled
    Code))
    at
    com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java(Compiled
    Code))
    at
    com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.jav a(Compiled
    Code))
    at
    com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled
    Code))
    at
    com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled
    Code))
    at
    com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink .java(Compiled
    Code))
    at
    com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink .java(Compiled
    Code))
    at
    com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.jav a(Compiled
    Code))
    at
    com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compil ed
    Code))
    at
    com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled
    Code))
    at
    com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled
    Code))
    at
    com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled
    Code))
    at
    com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled
    Code))
    And
    The heapdump also shows coldfusion code with large 8M
    objects. This is the source of the problem.
    21,228,000 [96] 5 com/ibm/ws/util/ThreadPool 0x33a9e748
    21,066,680 [56] 2 java/util/HashMap 0x33a96628
    21,066,600 [48] 8 array of java/util/HashMap$Entry
    0x32be0488
    18,431,608 [32] 3 java/util/HashMap$Entry 0x3726b7f0
    18,352,408 [136] 9 com/ibm/ws/util/ThreadPool$Worker
    0x30785dd8
    18,311,272 [32] 1 java/lang/ThreadLocal$ThreadLocalMap
    0x3781d318
    18,311,240 [112] 23 array of
    java/lang/ThreadLocal$ThreadLocalMap$Entry 0x3ac26e88
    18,307,136 [32] 3 java/lang/ThreadLocal$ThreadLocalMap$Entry
    0x3822ea28
    18,307,104 [160] 15 coldfusion/filter/FusionContext
    0x3e8be278
    9,863,608 [32] 1 coldfusion/runtime/LocalScope 0x3e8b49d8
    8,411,336 [96] 12 coldfusion/runtime/NeoPageContext
    0x3e8b4708
    8,390,800 [96] 11 coldfusion/runtime/NeoPageContext
    0x3e8bcc48
    8,388,904 [80] 4 coldfusion/runtime/NeoBodyContent
    0x3e8c2490
    8,388,664 [40] 2 coldfusion/runtime/CharBuffer 0x3e8b8870
    8,388,624 [8,388,624] 0 char[] 0x3f740130
    8,388,664 [40] 2 coldfusion/runtime/CharBuffer 0x3e8b8870
    160 [80] 4 coldfusion/runtime/NeoBodyContent 0x3e8c0f68
    8,388,904 [80] 4 coldfusion/runtime/NeoBodyContent
    0x3e8c2490
    88 [88] 3 coldfusion/runtime/NeoJspWriter 0x3e8bcaf8
    8,388,904 [80] 4 coldfusion/runtime/NeoBodyContent
    0x3e8c2490
    1,720 [32] 3 coldfusion/runtime/NeoPageContext$TagSet
    0x3e8b8970
    Any help or suggestions you can provide would be most
    appreciated.
    Cheers,
    David

    Hi,
    Please visit the URL below for a sample on how to display
    data in a DataGrid.
    http://livedocs.adobe.com/flex/3/langref/mx/controls/DataGrid.html#includeExamplesSummary
    Hope this helps.

  • Does this Sun Update apply to the coldfusion version of java?

    Does anyone know if this patch to Sun Java needs to be
    applied to the version of Java that automatically comes with
    Coldfusion 7?
    http://sunsolve.sun.com/search/document.do?assetkey=1-26-102934-1

    A) Quickly looking this over the bug is talking about image
    parsing by an applet. Neither of which would typically run inside a
    server.
    B) The fix is to upgrade to 1.4.2_15 or higher. CFMX7 has
    been certified with 1.4.2_16 which has many fixes over CFMX7's
    built in JRE. It also has the daylight savings time fixes and the
    fix to A. Why not just upgrade?

  • ColdFusion 9 change Java Default Locale ?

    I keep getting en error with
    en_MY must be one of the ColdFusion supported locales.
    The list of supported locales is stored in the variable Server.ColdFusion.SupportedLocales.
    The error occurred in E:\wamp\www\Test2\test.cfm: line 2
    1 : <cfform>
    2 : <cfinput type="datefield" name="test" value="dasd">
    3 : </cfform>
    I check my jvm detail, my java default locate is showing en_MY.
    I have try few way also can't solve my problem
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-6d 90.html
    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24 -67f2.html
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f a3.html
    After i complete setting with the intruction from the link , i try restart computer. but the java default locate still being same.

    Thank you.
    Currently I am using ColdFusion 9 and with multiserver.
    I could not found the jvm argument w/ "-Duser.language" or  "-Duser.region"
    In my jvm.config, i only found this is similar
    # Arguments to VM
    java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Dcoldfusion.rootDir={application.home}/
    I saw there is another file call wsconfig_jvm.config , but cant found it , the simiar is
    java.args=-Xms32m -Xmx128m
    # java.class.path - use this for adding individual jars or
    # directories.  When directories are included they will be searched
    # for jars and zips and they will be added to the classpath (in
    # addition to the directory itself), the jar to be used in launching
    # will be appended to this classpath

  • Realtime equivalent to Java's Thread.sleep()?

    I have an application that I want to guarantee that when I call Java's Thread.sleep(n) the thread will sleep for precisely that amount of time, or close to it at least. What we recently encountered though was that if the "wall clock" time is changed in one thread while a sleep is occurring in another thread, this clock change will impact when the sleeping thread will wake up.
    In our case, we had a simple Thread.sleep(1000), and during that one second period another thread set the clock back two minutes. The sleeping thread ended up sleeping roughly two minutes and a second instead of just a second. Apparently this is a "feature" of Thread.sleep(), and I can see in some cases (e.g. a task scheduler based on wall clock times) where this is exactly the behavior you'd want. However, in our case, we want the sleep function to sleep by the amount we specify, regardless of changes to the wall clock time. Is there a way to do this in Java? We are using JDK 1.5.

    You can use methods which rely on the nanoTime() (based on the number of clock cycles since the processor last reset)
    Classes such as LockSupport.parkUntil(someObject, nanoTime) may give you the accuracy/consistency you want. In this case you always wait the full delay.(and not unpack it)

  • Md5sum equivalent in java

    Hi,
    md5sum on solaris produces "9b9af6945c95f1aa302a61acf75c9bd6" for the string "abcde".
    But when I tried using the following sample code,
    MessagDigest md = MessageDigest.getInstance("MD5");
    String str = "abcde";
    byte[] bytes = md.digest(str.getBytes());
    StringBuffer hexString = new StringBuffer();
    for (int i=0;i<bytes.length;i++) {
    hexString.append(Integer.toHexString(0xFF & bytes));
    System.out.println(hexString.toString());
    This prints "ab56b4d92b40713acc5af89985d4b786".
    Why Java implementation of MD5 is different from md5sum of solaris. How can I achieve the same result.
    Thanks,
    Sreedhar.

    I have the answer now:
    I guess you got the md5sum on Solaris by typing the "abcde" into a file and running md5sum on the text file, right? Well, if you check the size of the file, you will see that it occupies 6 bytes and not 5, right? Well that's because it also contains the EOF (End Of File) byte, right after the text. So if you run md5sum on the file, it will include the EOF.
    Change your code to use the string "abc" instead of "abcde". This will return the digest string "90150983cd24fb0d6963f7d28e17f72". Then take a look at the reference digest for the string "abc" in the MD5 RFC http://www.ietf.org/rfc/rfc1321.txt at the bottom of the file. It says 900150983cd24fb0d6963f7d28e17f72. That's almost the same. The error in your code is that Integer.toHexString(0xFF & bytes) will return the string "1" for the byte with the value of 1, but should return "01".
    Change
    for (int i=0;i<bytes.length;i++) {
         hexString.append(Integer.toHexString(0xFF & bytes));
    to
    for (int i=0;i<bytes.length;i++) {
         String digit = Integer.toHexString(0xFF & bytes);
         if (digit.length() == 1) {
              digit = "0" + digit;
         hexString.append(digit);
    Then you will have a fully correct implementation of the MD5 digest.

Maybe you are looking for

  • Is there a way I can stream video from my 2012 AirMac to the Apple TV using airplay and at the same time stream the audio to an air speaker?

    Is there a way stream video from a 2012 MacBook Air to a TV using Apple TV and at the same time steam the audio to an air speaker. Also the same question but using an ipad

  • ExecuteUpdate() is not working

    I have a Statement and I am calling the executeUpdate() method to execute some SQL into my database. It says I'm using it from a static context, while my calling method is not! public void createTable()     { // describe Connection con, open connecti

  • Problem using numberConverter

    I'm getting an error when using the <f:numberConverter> tag. The first time I hit the page, everything works fine. When I open up a new browser or tab, and hit it again, I get the following error: 500 Internal Server Error javax.servlet.jsp.JspExcept

  • Openreach Issue with New Build

    I'm currently a BT customer (and up until now very happy) and am about to move house to a new build site in Worcester. I checked the broadband speed for the postcode and all is good, and infinity is available. However when I put in my exact house num

  • Nested synchronized blocks on multiple objects without deadlock

    Is it possible? Here is an example problem that exhibits deadlock: public class SomeObject {      public static class Foo {           private int n = 0;           public synchronized void p() {                n++;                if (n % 100 == 0)