Search:

Type: Posts; User: ardisamudra

Search: Search took 0.06 seconds.

  1. Replies
    8
    Views
    2,157

    [SOLVED] Re: [Asking] Convert String to Byte Array

    Hi Zaphod....

    Thanks for your code, so the full code perhaps like this below


    public static void convertStr2Byte() {
    String strKey = "BDE540BD7E91EDACA3B0125FE004F52C";
    ...
  2. Replies
    8
    Views
    2,157

    [SOLVED] Re: [Asking] Convert String to Byte Array

    Hi copeg...
    The current encoding have length 32. So in the array should be like this

    bytKey[0] = 0x42;
    bytKey[1] = 0x44;
    bytKey[2] = 0x45;
    ........
    ........
    bytKey[31] = 0x43;
  3. Replies
    8
    Views
    2,157

    [SOLVED] Re: [Asking] Convert String to Byte Array

    Hi, copeg..

    I expect the byte array from the String , may be I'm wrong about array example writing.

    The arrray should be like this :

    bytKey[0] = 0xBD;
    bytKey[1] = 0xE5;
    ........
    ........
  4. Replies
    8
    Views
    2,157

    [SOLVED] [Asking] Convert String to Byte Array

    Hi everyone,

    I get confused when to convert string to byte array. let's go to the code

    String strKey = "BDE540BD7E91EDACA3B0125FE004F52C";
    byte[] bytKey = strKey.getBytes();
    ...
Results 1 to 4 of 4