org.bif.common.utils.JcsUtil Maven / Gradle / Ivy
The newest version!
package org.bif.common.utils;
import org.erdtman.jcs.JsonCanonicalizer;
public class JcsUtil {
public static byte[] formatJcsDataByte(String jsonStr) throws Exception{
JsonCanonicalizer jsonCanonicalizer = new JsonCanonicalizer(jsonStr);
return jsonCanonicalizer.getEncodedUTF8();
}
public static String formatJcsData(String jsonStr) throws Exception{
JsonCanonicalizer jsonCanonicalizer = new JsonCanonicalizer(jsonStr);
return jsonCanonicalizer.getEncodedString();
}
}