Compare a string and a binary value

Hi!
I would like to compare two passwords encoded into two different's LDAP directory.
For these two directories, I have not the same libraries, so that the encoded value of the first password returned is a String, and the second one is a binary.
Could you tell me if it is possible to compare them?
Thanks a lot!
Best regards

Hi dwg,
in LDAP directories, there is no encryption. There is
hash coding.
The same method of hashcoding is used in the two
directories, but we do not have (and we cannot)
decode the data.
We only have to compare the two hashcoded values.
About the "binary", you are right. It is a byte
array.
How about this function:
equals (<string parameter>, new String(<array
parameter>, "UTF8"))
do you think it is OK?
Thanks for your help!So you have a hashcode from one directory, and a plaintext String from the other? In that case you have to hash the plain String and then compare the two hashes. You can't turn a hash back into a String, which you seemed to point out when you said "but we do not have (and we cannot) decode the data."

Similar Messages

  • Assigning a hex value to a variable and getting binary value of a variable.

    I try to develop java programs and I need to do a conversion unicode to EBCDIC and vice versa.
    How can I assign hex values to variables to build UTF-EBCDIC and EBCDIC-UTF table and get hex or binary value of data to compare it to value of in the table?
    I did a conversion like this with PL/1 before. I do not know how can I do it with Java. Because I am new to Java.
    Thank you in advance.

    I will run java code in mainframe and java uses
    unicode for data in default and mainframe environment
    is EBCDIC. So I have to translate the data from
    unicode to ebcdic.I said I think String supports EBCDIC encoding...
    String ebcdic = new String(ebcdicBytes, "Cp500");
    http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html

  • Compare two strings and the save the greater

    To devolop a vi,it can compare two strings.A string is gived,the other is saved previously.If greater,then save,or do nothing.

    Hi,
    I am assuming by "greater" you mean the string length.
    Use the string length function from the strings palette, with shift-registers on a while loop. Write to the shift-register the "greater" string.
    I am attaching a diagram screenshot for this. NOTE: depending on how you want this VI to run, you can move the input and output string control and indicator inside our outside the while loop.
    Hope this is what you were looking for.
    Khalid
    Attachments:
    strlen.gif ‏17 KB

  • Two strings and a numeric value to write to a measurement file

    Hi all, I need to write two string values and a number value to file. I made a basic VI showing what is needed. I figured to cheat a little by sending my time stamp to the comment node. I then converted the id string to a decimal number and merged it to my numeric value. All is great with the output in Excel, accept my ID string dropped the last two digits and replaced them with a zero. Even if I used a numeric constant with this same value, it replaces the last to with zero's. The problem seems to reside with the write to measurement file VI. If I open it directly with wordpad it saves it as 2.602189E+8. Any ideas to save these three values?   Thanks
    Gerald

    When you use one of the Express VIs, you are limited to what you can do. The Write to Measurement File expects to writing measurements (numerics) and not string constants so eveything gets converted to floating point. You could probably modify it but using the lower level file I/O functions is just as simple. Here's a modification. I put the file write inside the loop because I would assume you want every value written. With your example, you would only save the very last iteration. If you do only want to save the last result, then it can be suitably modified.
    Attachments:
    time_insert_mod.vi ‏15 KB

  • Function to compare tow dates and set the value

    Hi All,
     I have two dates with close date and Due date.And i want to set the value as 1 if close date is less then or equal to to due date else 0 .And my other condition is to set  1 when close date is greater the due date.Can any one help me how can I
    achieve it.
    Thanks, Sid

    Hello Sid,
    For this you can use a simple IF Statement with a compare on the Dates:
    = If(Tabelle1[CloseDate] <= Tabelle1[DueDate]; 1; 0)
    = IF(Tabelle1[CloseDate] > Tabelle1[DueDate]; 1; 0)
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Compare two strings and verify they have same alphabets

    If i have two strings....s and t. I want to return whether s contains every letter in t. For example, "abcd" contains all the letters in "bbdc", since every letter in the second string appears in teh first.
    thanx

    If i have two strings....s and t. I want to return
    whether s contains every letter in t. For example,
    "abcd" contains all the letters in "bbdc", since every
    letter in the second string appears in teh first.This will do the job in s.length()*t.length() steps.
    //  Indicates whether s contains every letter in t.
    boolean allCharsContainedIn(String s, String t) {
        int len = t.length();
        for (int i = 0; i < len; i++) {
            if (s.indexOf(t.charAt(i) == -1)
                return false;
        return true;
    }S&oslash;ren

  • Comparing 2 strings

    hi
    i have an application, in which, i am taking a string as input from th user(thru a JOptionpane.inputDialog)
    now, i have to compare this string with various other values present in an already stored file.
    please sugest a method to do so.
    the file has different values appended one after another , separated by a space.
    the problem is, i want to parse the entire file, to look for the required value.
    please help.
    thank u.

    Parse the file once using a thread as soon as the program has started running.
    If you just want to know whether or not a value is in the file then just store the values from the file in a Set (java.util.HashSet).
    If you want to associate a value with some other information then store the (key,value) pairs read from the file in a Map (java.util.HashMap).
    If you want to record information about what the user has entered then again store the file informaion in a Map but make the value an object of your own making.

  • I want to convert two image files into strings and than to compare them. This is easy, but how to mention where the difference exist?

    I have two image file in bmp file format. How to convert them into string and to check if they are differnt or same. If different how to mention or find that where the difference exists. This idea have to be extented with video application as well.

    Hi,
    if you have vision, you could use the functin IMAQ Image to Array to have a 2D array of the pixel values.
    You can then compare pixel by pixel; if your images come from a camera, I would recommend to set a treshold of acceptance.
    This is a time consuming solution anyway.
    Alternative methods:
    1) Make a subtraction of the two images, the resulting image will be the difference of them
    2 ) Use IMAQ LogDiff function (operators palette)
    3) Calculate the histogram of both image and compare the histogram reports
    Good luck,
    Alberto

  • How to compare two strings whether both are equal while ignoring the difference in special characters (example: & vs & and many others)?

    I attempted to compare two strings whether they are equal or not. They should return true if both are equal.
    One string is based on Taxonomy's Term (i.e. Term.Name) whereas other string is based on String object.
    The problem is that both strings which seem equal return false instead of true. Both string values have different special characters though their special characters are & and &
    Snapshot of different design & same symbols:
    Is it due to different culture or language?
    How to compare two strings whether both are equal while ignoring the difference in special characters (& vs &)?

    Hi Jerioon,
    If you have a list of possible ambiguous characters the job is going to be easy and if (& vs &) are the only charracters in concern awesome.
    You can use the below solution.
    Before comparing pass the variables through a replace function to standarize the char set.
    $Var = Replace($Var,"&","&")
    This is going to make sure you don't end up with ambiguous characters failing the comparison and all the char are "&" in this case.
    Similar technique is used to ignore Character Cases 'a' vs. 'A'
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • How to check empty string and null? Assign same value to multiple variables

    Hi,
    1.
    How do I check for empty string and null?
    in_value IN VARCHAR2
    2. Also how do I assign same value to multiple variables?
    var_one NUMBER := 0;
    var_two NUMBER := 0;
    var_one := var_two := 0; --- Gives an error
    Thanks

    MichaelS wrote:
    Not always: Beware of CHAR's:
    Bug 727361: ZERO-LENGTH STRING DOES NOT RETURN NULL WHEN USED WITH CHAR DATA TYPE IN PL/SQL:
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is NOT null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> alter session set events '10932 trace name context forever, level 16384';
    Session altered.
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Date from a string and int value in ssis

    hi so my table is as follows
    active      expirymonth     
    expiryyear
    0              October                         2014
    0              February                            2015
    1               January                        2012
    and so on
    now my requirement is that if active =0 then in a new table lets say LASTDATE and they want a date with the last day of the expiry month and year  and if active is anything else write NULL for eg
    LASTDATE
    10/31/2014
    02/28/2015
    NULL
    I went to derived tables and made a new table called lastdate. What expression do i build in the expression builder to get the required result as i could not find a way to convert the text into int and then into a date

    Hi Bharatb111,
    If you want to achieve this using Derived Columns transform, you have to use following expression to first convert the month name value to integer:
    ([expirymonth]==”January”)?1:([expirymonth]==“February”)?2: ([expirymonth]==”March”)?3:([expirymonth]==“April”)?4:5
    However, if we need to validate a couple of or even all of twelve months, the expression validation will be failed. So, the Derived Column approach is impossible.
    To achieve your goal, you can use a Script Component to perform the date format conversion. This way, we can convert “dd/MMMM/yyyy(such as “01/October/2014”) format string value to “MM/dd/yyyy” (such as “10/01/2014”), and assign this value to a new output
    column (assuming its name is “DateVal” and its data type is DT_DATE) of the Script Component. Then, we can drag a Derived Column under the Script Component and connect them. In the Derived Column, we can add a new column named “LASTDATE” with the following
    expression:
    ([active]==0)?DATEADD(“d”,-1, DATEADD(“Month”),1,DateVal]):NULL(DT_DATE)
    For the Script Component code snippet, please refer to Reza’s answer:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1661339c-252c-4197-9cfd-943e1d86b573/convert-a-string-to-date-format?forum=sqlintegrationservices 
    Hope this helps.
    Regards,
    Mike Yin
    TechNet Community Support

  • How do I click on a cell in a table control, and display the value in a string?

    What I would like to do is to click on a cell in a table control, and have the value of the cell be displayed in a string indicator. What ever cell I click on, I would like the value to be displayed in the indicator.
    Thank you!
    Solved!
    Go to Solution.

    ... or
    Event >>> ouse down for table.
    Use Coords" to feed invoke node "point To Row Column" and returned "Cell Postion" can be unbundled to produce the row and column tht can be used to index out the value.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Compare two columns and match ALL recurring values, not just the first instance

    Hi everybody...
    I was looking for a way to compare values in two columns, identifying every duplicate value instance on a third column.
    Searching around the forums, I found a solution, albeit a partial one; I am using this formula: =IFERROR("Duplicate in row "&MATCH($A,$B,0),"") along column C, to compare values between columns A and B. When applied, the formula will render the first instance where there is a duplicate; unfortunately MATCH will only register the first instance of the duplicated values.
    For example:
    The first value on column A is 'Apple'. On column B there are three instances for the value 'Apple', the formula identifies the first of these values, but not the remaining two.
    I am not an advanced Numbers or Excel user, and the answer to this problem eludes me. I am attempting to compare columns that have no less than 1000 rows each, so you can imagine how, finding a solution to my problem would be really great.
    Thanks in advance,
    Pablo

    Unfortunately I can't see your screenshot, but supposing you have a table like this:
    Col1
    Col2
    1
    3
    Dupe
    2
    4
    Dupe
    3
    5
    Dupe
    4
    6
    5
    7
    Then here is one way to flag the duplicates.
    The formula in C2, copied down, is:
    =IF(COUNTIF($A,$B2)≥1,"Dupe","")
    Then filter on column C for 'Dupe', and copy the values in column B to wherever you need them.
    SG

  • How does "Unflatten From String" take a type and return a value of that type?

    http://zone.ni.com/reference/en-XX/help/371361E-01/glang/unflatten_from_string/
    How exactly does the "type" argument for "Unflatten From String" work? I need to create a VI that takes a type, passes it as an argument to several calls of the "Unflatten From String" function, and returns an array containing elements of the type originally passed. The "Unflatten From String" function seems to do some magic though, because the type of the "value" that it outputs changes depending on the type it is passed as input. How do I do the same magic in my VI?
    Ultimately, what I need to accomplish is an unflatten-list operation. Given a type T and a byte string of length L (which contains a concatenation of T elements that are flattened to their bytes), create a VI that unflattens all the types in the string and return an array of length (L / sizeof(T)) that contains each type.
    Note: performing the unflatten-list operation is trivial, but I cannot for the life of me figure out how to do it in a VI that takes a type and returns an array of the appropriate type. By the way, my data is being given to me from another source, so please don't bother suggesting that I should be flattening an array using LabVIEW's "Flatten To String" function in the first place. My data is not given in LabVIEW's array format: http://zone.ni.com/reference/en-XX/help/371361B-01/lvconcepts/flattened_data/
    Thanks a ton!
    -Wakka

    Take a look at this example:  You can see that the flattened string contains several bytes.  The first four bytes contain the length of array (number of elements).  Since the data type is U32, the next 32 bits (4 bytes) contains the value of the first element, and so on.  Could you possibly use this scheme to do what you want to do?  Other data types present different outputs.  You would have to experiment with them.
    - tbob
    Inventor of the WORM Global

  • ReferenceError: Error #1069: Property DSPriority not found on String and there is no default value.

    Hi All
                      This is the Error where i got from my sample chatting application...
    ReferenceError: Error #1069: Property DSPriority not found on String and there is no default value.
    at mx.messaging::Producer/handlePriority()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messagi ng\Producer.as:190]
    at mx.messaging::Producer/internalSend()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging \Producer.as:169]
    at mx.messaging::AbstractProducer/send()[E:\dev\4.x\frameworks\projects\rpc\src\mx\messaging \AbstractProducer.as:561]
    at SampleMessagin/sendMessage()[D:\FlexJavaPrograms\SampleMessagin\src\SampleMessagin.mxml:2 9]
    at SampleMessagin/___SampleMessagin_Button2_click()[D:\FlexJavaPrograms\SampleMessagin\src\S ampleMessagin.mxml:74]
                        this is the code
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
          currentState="{st}"
          creationComplete="consumer.subscribe()">
    <fx:Script>
      <![CDATA[
       import mx.messaging.events.MessageEvent;
       import mx.messaging.messages.AsyncMessage;
       import mx.messaging.messages.IMessage;
       import mx.modules.IModule;
       import mx.states.State;
       [Bindable]
       public var st:String="";
       public function changeStateHandler(event:Event):void
        st = "Login"
       //send message throug this method
       protected function sendMessage():void
        var msg:IMessage = new AsyncMessage();
        msg.headers = uname.text;
        msg.body = sendText.text;
        producer.send(msg);
        sendText.text = " ";
      //message  Handler  
       protected function consumer_messageHandler(event:MessageEvent):void
        // TODO Auto-generated method stub
        var resp:IMessage = event as IMessage;
        dispText.text = resp.headers.toString()+" :: "+resp.body.toString()+"\n";
      ]]>
    </fx:Script>
    <fx:Declarations>
      <s:Producer id="producer"
         destination="chat"/>
      <s:Consumer id="consumer"
         destination="chat"
         message="consumer_messageHandler(event)"/>
      </fx:Declarations>
    <s:states>
      <s:State name="State1"/>
      <s:State name="Login"/>
    </s:states>
    <s:Panel x="246" y="137" width="366" height="200" title="Login Here" includeIn="State1">
      <mx:HBox horizontalCenter="2" verticalCenter="-30">
       <s:Label text="Enter UR Name"/>
       <s:TextInput id="uname"/>
       <s:Button id="login" label="Login" click="changeStateHandler(event)"/>
      </mx:HBox>
    </s:Panel>
    <s:Panel includeIn="Login" x="327" y="78" width="353" height="369"  title="Welcome:{uname.text}">
      <s:TextArea x="6" y="11" height="222" width="335" id="dispText"/>
      <s:TextArea x="10" y="241" height="85" width="258" id="sendText"/>
      <s:Button x="276" y="241" label="Send" height="76" click="sendMessage()"/>
    </s:Panel>
    </s:Application>
    and my messaging-config.xml is as follows
                 <?xml version="1.0" encoding="UTF-8"?>
    <service id="message-service"
        class="flex.messaging.services.MessageService">
        <adapters>
            <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true" />
            <!-- <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/> -->
        </adapters>
        <default-channels>
            <channel ref="my-polling-amf"/>
        </default-channels>
        <destination id="chat"/>
    </service>
                      can any one help me what is the error present here.............
                         why it is showing error .. am i wrote anything wrong in this code .. please help me....

    I'm not the expert on this topic, but I think this line:
    msg.headers = uname.text;
    ...is throwing the error. Look into how to properly construct the headers for the message. They should be in name/value pairs.

Maybe you are looking for

  • Single payment for Multiple vendor with Common Remit to payee

    HI 2 vendors "A" and "B" maintained with common remit to payee as "X "Vendor. 2 PO created and 2 invoice created. both the invoice are open for payment. When i run automatic payment with both the vendor, can i get single payment cheque ?. Payment met

  • Cannot get Message_ID in process

    Hi all In the process I create a Transformation to get the message_id with the code: <b> java.util.Map map = container.getTransformationParameters(); String msgid = (String) map.get ( StreamTransformationConstants.MESSAGE_ID); return msgid; </b> the

  • SOAP Adapter Help Needed

    Hi, I have a scenario where i need to call the Web Service on the Traget Side. I know how to configure the SOAP Adapter to do this but i am facing an issue here. The Webservice Expects the SOAP request to be in the form. I don't know how to bring thi

  • Ipad March Calendar Issues

    With regards to this issue of the March calendar I solved this by turning off my Public UK Holidays tab and will turn it back on in April. I do think that Apple should monitor these issues and assist we that have paid good money for this technology i

  • No Batch through BAPI_BATCH_CREATE and BAPI_OBJCL_CHANGE_KEY

    Hi Guys Dont understand why cant I be able to create batch using BAPI_BATCH_CREATE  that has a corresponding object ID in table INOB. Subsequently I am trying to create the classification in that batch after creating it manually through MSC1N, still