Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: how to recreate a value created by the add checksum step

  1. #1
    Join Date
    Jul 2009
    Posts
    2

    Default how to recreate a value created by the add checksum step

    I am trying to match a checksum generated by the 'add checksum' step and seem to be having issues when attempting to recreate the checksum by hand.

    In this case it is a combination of 4 columns from each record and so I guess the question is how should I be presenting them to my hashlib/routine? (e.g. as an object, delimited string, list, dictionary??)
    Depending on the answer are they named or indexed? ... all crammed together with one big concat?

    Thanks in advance!
    Last edited by widgit68; 08-18-2009 at 10:34 PM.

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Have a look at the source code... from memory... all crammed together.

    Regards,
    Sven

  3. #3

    Default

    I believe you want to look at:
    org.pentaho.di.trans.steps.checksum;

    Carlos Castro

  4. #4
    Join Date
    Jul 2009
    Posts
    2

    Default

    It looks like it separates fields with a hyphen via a call to getString().

    Thanks again for the tips.

    --- begin cut ---
    private static String getString(byte[] bytes) {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < bytes.length; i++) {
    byte b = bytes[i];
    sb.append((int) (0x00FF & b));
    if (i + 1 < bytes.length) {
    sb.append("-");
    }
    }
    return sb.toString();
    --- end cut ---

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.