How to generate a unique 8 byte number for a String in DES

Hi All,
Is there any way to generate a unique 8 byte number representation of String?
I know it can be done with DES encryption (while MD5 gives 16 bytes number). My requirement is:
Every time a String is passed - my static method should return the same unique number - all the time.
i.e A String "AAAAAA" will return same unique number all the time. How can I achieve this (8 byte number) by DES Encryption or any other encryption?
Thanking all in advance.

Thanks for your reply. Won't there be any loss of data if I consider only first 8 bytes? Will Integrity be maintained.?
In some cases my Strings can be unusually long - having length of 400 to 500.
I want 8 bytes as I want to map the number with MySQL bigint field.

Similar Messages

  • How to generate a Unique key based on a some String value

    Hello every one,
    I am sorry , If I post this question in wrong group... I have a requirement to generate a unique key ( what every it may be alpha, numeric or alpha numeric) based on some String..
    For ex : String str = "AbCX" - Gives a unique key based on "AbCX" value..
    Is there any way we can get the unique value using Java ?
    Thanks

    May be not what you are looking for, but here's may idea:
    use a sequence (db sequence) and add it the the string value. This way the value is unique, because the sequence is unique. So you could omit the string theoretically, but your requirement is met.
    It's very easy to get a unique sequence number from the db using java, depending of the technology you use (which you did not say :-( )
    Timo

  • How to generate report with dynamic variable number of columns?

    How to generate report with dynamic variable number of columns?
    I need to generate a report with varying column names (state names) as follows:
    SELECT AK, AL, AR,... FROM States ;
    I get these column names from the result of another query.
    In order to clarify my question, Please consider following table:
    CREATE TABLE TIME_PERIODS (
    PERIOD     VARCHAR2 (50) PRIMARY KEY
    CREATE TABLE STATE_INCOME (
         NAME     VARCHAR2 (2),
         PERIOD     VARCHAR2 (50)     REFERENCES TIME_PERIODS (PERIOD) ,
         INCOME     NUMBER (12, 2)
    I like to generate a report as follows:
    AK CA DE FL ...
    PERIOD1 1222.23 2423.20 232.33 345.21
    PERIOD2
    PERIOD3
    Total 433242.23 56744.34 8872.21 2324.23 ...
    The TIME_PERIODS.Period and State.Name could change dynamically.
    So I can't specify the state name in Select query like
    SELECT AK, AL, AR,... FROM
    What is the best way to generate this report?

    SQL> -- test tables and test data:
    SQL> CREATE TABLE states
      2    (state VARCHAR2 (2))
      3  /
    Table created.
    SQL> INSERT INTO states
      2  VALUES ('AK')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AL')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('AR')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('CA')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('DE')
      3  /
    1 row created.
    SQL> INSERT INTO states
      2  VALUES ('FL')
      3  /
    1 row created.
    SQL> CREATE TABLE TIME_PERIODS
      2    (PERIOD VARCHAR2 (50) PRIMARY KEY)
      3  /
    Table created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD1')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD2')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD3')
      3  /
    1 row created.
    SQL> INSERT INTO time_periods
      2  VALUES ('PERIOD4')
      3  /
    1 row created.
    SQL> CREATE TABLE STATE_INCOME
      2    (NAME   VARCHAR2 (2),
      3       PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
      4       INCOME NUMBER (12, 2))
      5  /
    Table created.
    SQL> INSERT INTO state_income
      2  VALUES ('AK', 'PERIOD1', 1222.23)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('CA', 'PERIOD1', 2423.20)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('DE', 'PERIOD1', 232.33)
      3  /
    1 row created.
    SQL> INSERT INTO state_income
      2  VALUES ('FL', 'PERIOD1', 345.21)
      3  /
    1 row created.
    SQL> -- the basic query:
    SQL> SELECT   SUBSTR (time_periods.period, 1, 10) period,
      2             SUM (DECODE (name, 'AK', income)) "AK",
      3             SUM (DECODE (name, 'CA', income)) "CA",
      4             SUM (DECODE (name, 'DE', income)) "DE",
      5             SUM (DECODE (name, 'FL', income)) "FL"
      6  FROM     state_income, time_periods
      7  WHERE    time_periods.period = state_income.period (+)
      8  AND      time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
      9  GROUP BY ROLLUP (time_periods.period)
    10  /
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> -- package that dynamically executes the query
    SQL> -- given variable numbers and values
    SQL> -- of states and periods:
    SQL> CREATE OR REPLACE PACKAGE package_name
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4    PROCEDURE procedure_name
      5        (p_periods   IN     VARCHAR2,
      6         p_states    IN     VARCHAR2,
      7         cursor_name IN OUT cursor_type);
      8  END package_name;
      9  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY package_name
      2  AS
      3    PROCEDURE procedure_name
      4        (p_periods   IN     VARCHAR2,
      5         p_states    IN     VARCHAR2,
      6         cursor_name IN OUT cursor_type)
      7    IS
      8        v_periods          VARCHAR2 (1000);
      9        v_sql               VARCHAR2 (4000);
    10        v_states          VARCHAR2 (1000) := p_states;
    11    BEGIN
    12        v_periods := REPLACE (p_periods, ',', ''',''');
    13        v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
    14        WHILE LENGTH (v_states) > 1
    15        LOOP
    16          v_sql := v_sql
    17          || ',SUM(DECODE(name,'''
    18          || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
    19          || '"';
    20          v_states := LTRIM (SUBSTR (v_states, 3), ',');
    21        END LOOP;
    22        v_sql := v_sql
    23        || 'FROM     state_income, time_periods
    24            WHERE    time_periods.period = state_income.period (+)
    25            AND      time_periods.period IN (''' || v_periods || ''')
    26            GROUP BY ROLLUP (time_periods.period)';
    27        OPEN cursor_name FOR v_sql;
    28    END procedure_name;
    29  END package_name;
    30  /
    Package body created.
    SQL> -- sample executions from SQL:
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         CA         DE         FL                                             
    PERIOD1       1222.23     2423.2     232.33     345.21                                             
    PERIOD2                                                                                            
    PERIOD3                                                                                            
                  1222.23     2423.2     232.33     345.21                                             
    SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR                                                        
    PERIOD1       1222.23                                                                              
    PERIOD2                                                                                            
                  1222.23                                                                              
    SQL> -- sample execution from PL/SQL block
    SQL> -- using parameters derived from processing
    SQL> -- cursors containing results of other queries:
    SQL> DECLARE
      2    CURSOR c_period
      3    IS
      4    SELECT period
      5    FROM   time_periods;
      6    v_periods   VARCHAR2 (1000);
      7    v_delimiter VARCHAR2 (1) := NULL;
      8    CURSOR c_states
      9    IS
    10    SELECT state
    11    FROM   states;
    12    v_states    VARCHAR2 (1000);
    13  BEGIN
    14    FOR r_period IN c_period
    15    LOOP
    16        v_periods := v_periods || v_delimiter || r_period.period;
    17        v_delimiter := ',';
    18    END LOOP;
    19    v_delimiter := NULL;
    20    FOR r_states IN c_states
    21    LOOP
    22        v_states := v_states || v_delimiter || r_states.state;
    23        v_delimiter := ',';
    24    END LOOP;
    25    package_name.procedure_name (v_periods, v_states, :g_ref);
    26  END;
    27  /
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
    PERIOD             AK         AL         AR         CA         DE         FL                       
    PERIOD1       1222.23                           2423.2     232.33     345.21                       
    PERIOD2                                                                                            
    PERIOD3                                                                                            
    PERIOD4                                                                                            
                  1222.23                           2423.2     232.33     345.21                       

  • How do I get the activation serial number for

    I've downloaded Photoshop CS6 Extended trial version. How do I get the activation serial number for this software

    You will need to buy the software.

  • Firstly I updated my ipad into ios7 and after watching the video by Apple, iWork, pages and numbers are free for download after updating iOS 7. How can I download iWork pages and number for free?

    Firstly I updated my ipad into ios7 and after watching the video by Apple, iWork, pages and numbers are free for download after updating iOS 7. How can I download iWork pages and number for free? Please help me.

    stevejobsfan is correct; iwork for ios is free only for new purchases of new ios devices. A good work around (if you have wifi connectivity) is going to the icloud website on your ipad, and working on your document.
    A word of caution (the real reason I am responding to your post). If you do a lot of 'formatting' of a document on iwork for mac, and then save it in icloud; you will probably loose most of the formatting you have done (this will be true if you oppen the document in iwork for ios; also) It happened to me, and I did not duplicate the document before saving it to icloud; I lost at least an hours worth of work.

  • How do I enter my new registration number for Quicktime Pro?

    How do I enter my new registration number for quicktime pro?

    Open QuickTime Player 7 and then the Edit menu /  Preferences / Register

  • How to generate a list of  pick dates for all scheduled deliveries?

    Hi!
      How to generate a list of  pick dates for all scheduled deliveries?
      What all the tables involved?
    Thanks
    Imran.

    Thanks for the suggestion concerning the file path.  And certainly it would have been nice to have done this before beginning.  However this is a project that has been around for quite a while, and the files have been moved into different bins.  And now the project sequence is being revised.
    So the problem is, worded slightly differently, how can I search all of the bins for the files that are used just by this sequence, ignoring the files which are used by other sequences?  Or, how can I get a list of the file paths of the files that are used in the sequence?

  • How do you find Apple Support phone number for warranty for Mac Mini?

    How do you find Apple Support phone number for warranty for Mac Mini?

    1-800-APL-CARE? Should be able to direct you to the proper person.

  • How do you find the iPad phone number for cellular data?

    How do you find the iPad phone number for cellular data?

    I know this post was a long time ago but people still seem to be viewing it.
    Quickest way:
    Via the iPad on 3G, go to http://m.telstra.com. The service number is then displayed and you are given the option to recharge.

  • HT2731 How do I change my credit card number for my Itune account

    How do I change my cretit card number for my itune account

    Click on your name in the top right corner of iTunes, enter your password, click on view account and then payment info.

  • How to generate Serial(Unique) Number for finished goods?

    Guru's,
    How do i generate Serial(Unique) Numbers for finished goods.Suppose,if we get an order for a finished good A of 10 qty.We want to generate unique number to identify each and every A item separately for quality purpose.Any help is much appreciated.
    thanks Guru's

    Depending on serial control of item, you will need to generate serial numbers at the time of WIP Completion transaction using Serial Entry window (i.e. if serial control is At Receipt) or at the time of job creation (i.e. if you are using serial control as predefined)
    In latter case, you will have to use MES or MSCA screens to perform serialized WIP completion.
    Thanks,
    Hrishi

  • How to generate a unique WSDL for two webservices ?

    Hi ,
    Does anyone know if there is a way to generate a unique WSDL file for two webservices ?
    Actually, the problem is more general. I have two EJB that are exposed through web services. They both contain a simple data structure that is passed back and forth.
    The Client is a C# GUI and it is having problems with that data structure. Even if it is the same data structure with the same namespace, it seems it as two different objects and so creates two different stubs ...
    I am trying to work around that from the server side, bc it does not seem that we can do it from the C# application.
    First, I am trying to generate just one WSDL that would include both webservices but I can't seem to find an easy way of doing that.
    Second, I have heard that the complex types could be referenced externaly and I think that it would do the trick as well. I don't know how to do that either.
    I am using ServiceGen Ant tags to generate my web services from an EJB.
    Did anyone encounter that issue ?
    Can any one help ?
    Thanks a lot
    Farez

    hi,
    go to t-code SNRO and create a number range from 0 to 99999999.
    call the below fm in the report by passing the created number range name to fm to generate the new number every time..
    see
    NUMBER_GET_NEXT Get next free number in a range
    CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
    NR_RANGE_NR = '01'
    OBJECT = 'YPOLLID'        "number range name created in SNRO.
    IMPORTING
    NUMBER = LS_NUMBER.       "new number with one increment..
    or
    you can try..
    you can use following code.
    select max( num ) from z_table into v_max_num.
    v_max_num = v_max_num+1.
    Regards,
    prabhudas

  • How can I change my credit card number for my Adobe ID?

    Hello,
    I'd like to change my credit card number, but Adobe site do not allow this.
    Support chat redirected me to a chinese adobe page (I'm from Hungary, can't read Chinese..), then told me to call local reseller support instead.
    Local reseller support told us that they can't support creative cloud members, they are being dealt with centrally by Adobe.
    Back to chat, describing again what I need to a new agent..
    Got the same chinese page from him as well first, then got the same "call local reseller" advice again.
    After telling the agent that does not work, he gave me a phone number to call: 852 2916 2125, which never answers. And the agent dropped off..
    I haven't been so depressed over a customer support for years.
    Can somebody please help me out on how to change my credit card number for my Adobe ID?
    Thanks for any useful help in advance.

    Ok, found a way:  "under the billing section of your subscription within the My Adobe section of Adobe.com after you login with your Adobe ID "
    But after updating my info with my new (working) credit card (matercard) it says:
    There was a problem in the store. If you wish to complete your purchase immediately, please call 800 0280148.
    And this number than answers 'it cannot be accessed'
    I'd need this done immediately, so please anyone - any ideas ?!
    Thanks.

  • I bought a volume license for CS6. How do I now get a serial number for prior version (CS5.5)?

    I bought a volume license for CS6 Design Standard. Because of my system restrictions for now I can only run a prior version (CS5.5). I have also previously downloaded its trial version which works perfect. Now, after buying a license for CS6 I would like to get a serial number for a prior version as well. How would I go about receiving it?
    Many thanks in advance!
    Nelle

    Hi Nelle,
    You can request downgrade from Adobe, but you can't get back to CS6 after that, so it might be better to upgrade your system?
    Anyway, in my laptop CS6 has been running faster and better than CS5.5 without any changes to system, so you could give it a try before downgrading...
    Joni

  • Doe anyone know how to get a new password/pairing number for a magic mouse

    does anyone know how to get password of pairing number for my magic mouse

    There is no password or number (as is the case with keyboards). Please see this page for instructions:
    http://support.apple.com/kb/HT2845

Maybe you are looking for