All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.savl.ripple.encodings.common.B16 Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package com.savl.ripple.encodings.common;


import static org.bouncycastle.util.encoders.Hex.toHexString;

public class B16 {
    public static String toStringTrimmed(byte[] bytes) {
        int offset = 0;
        if (bytes[0] == 0) {
            offset = 1;
        }
        return toHexString(bytes, offset, bytes.length - offset).toUpperCase();
    }
    @Deprecated
    public static String toString(byte[] bytes) {
        return encode(bytes);
    }
    public static String encode(byte[] bytes) {
        return toHexString(bytes).toUpperCase();
    }
    public static byte[] decode(String hex) {
        return org.bouncycastle.util.encoders.Hex.decode(hex);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy