Example usage for org.apache.commons.codec.digest DigestUtils md5Hex

List of usage examples for org.apache.commons.codec.digest DigestUtils md5Hex

Introduction

In this page you can find the example usage for org.apache.commons.codec.digest DigestUtils md5Hex.

Prototype

public static String md5Hex(String data) 

Source Link

Usage

From source file:com.teamj.distribuidas.servicios.TestServicio.java

public static void main(String[] args) {
    System.out.println(DigestUtils.md5Hex("admin"));
    ;
}

From source file:costumetrade.common.login.LoginAgent.java

public static void main(String[] args) {
    System.out.println(DigestUtils.md5Hex("111111"));
}

From source file:com.glaf.core.test.EncodeTest.java

public static void main(String[] args) {
    for (int i = 0; i < 100; i++) {
        String str = RequestUtils.encodeString(String.valueOf(i) + "_" + UUID32.getUUID());
        System.out.println(RequestUtils.decodeString(str));
    }/*  w  ww . ja  va  2  s  . co  m*/
    System.out.println();
    System.out.println(RequestUtils.encodeString("20140805/lfm-0000001"));
    System.out.println(RequestUtils.decodeString(
            "4b6a68716c64614e75724a4448353538514b57323065724536556d65614a6d324e497665594f6d493452614232446a415353656969734b526d426a41306b697175365536393150716264513d"));
    String salt = DigestUtils.md5Hex(SystemConfig.getToken());
    System.out.println(salt);
}

From source file:com.ctrip.utils.SignatureUtils.java

public static void main(String[] args) throws NoSuchAlgorithmException {
    System.out.println(DigestUtils.md5Hex("abcdefg123456").toUpperCase());
    System.out.println(SignatureUtils.getSignature("1234567890", "1", "abcdefg123456", "50", "OTA_Ping"));
}

From source file:com.example.bigtable.simplecli.Loader.java

public static void main(String argv[]) throws IOException {
    String inputFile = "/tmp/pagecounts-20160101-000000";

    // Connect//from  w  w w.j a v  a 2s . c  o m
    Connection bigTableConnection = ConnectionFactory.createConnection();

    // Load the file, and do stuff each row
    Stream<String> stream = Files.lines(Paths.get(inputFile));
    stream.forEach(row -> {

        String[] splitRow = row.split(" ");
        assert splitRow.length == 4 : "unexpected row " + row;

        String hour = "20160101-000000"; //from file name
        String language = splitRow[0];
        String title = splitRow[1];
        String requests = splitRow[2];
        String size = splitRow[3];

        assert language.length() == 2 : "unexpected language size" + language;

        // create a row key
        // [languageCode]-[title md5]-[hour]
        String rowKey = language + "-" + DigestUtils.md5Hex(title) + "-" + hour;
        System.out.println(rowKey);

        // Put it into Bigtable - [table name]
        try {
            Table table = bigTableConnection.getTable(TableName.valueOf("wikipedia-stats"));

            // Create a new Put request.
            Put put = new Put(Bytes.toBytes(rowKey));

            // Add columns: [column family], [column], [data]
            put.addColumn(Bytes.toBytes("traffic"), Bytes.toBytes("requests"), Bytes.toBytes(requests));
            put.addColumn(Bytes.toBytes("traffic"), Bytes.toBytes("size"), Bytes.toBytes(size));

            // Execute the put on the table.
            table.put(put);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    });

    // Clean up
    bigTableConnection.close();
}

From source file:com.webarch.common.lang.Digest.java

public static void main(String args[]) {
    System.out.println(generateSourceString("sdfa", "ggggg", "wwwww"));
    System.out.println(signatureString("sdfa", "ggggg", "wwwww"));
    System.out.println("" + DigestUtils.md5Hex("?"));
    System.out.println(/*from   w  w w.j  av a 2  s.c  om*/
            StringUtils.join(base64Code("utf-8", "46d045ff5190f6ea93739da6c0aa19bc", "ggggg", "wwwww"), "-"));
    System.out.println(StringUtils.join(
            base64Decode("utf-8", "NDZkMDQ1ZmY1MTkwZjZlYTkzNzM5ZGE2YzBhYTE5YmM", "Z2dnZ2c", "d3d3d3c"), "-"));
}

From source file:com.dianping.lion.service.impl.UserServiceImplTest.java

public static void main(String[] args) throws FileNotFoundException, IOException {
    System.out.println(DigestUtils.md5Hex("!QAZxsw2").toUpperCase());
    //      Properties properties = new Properties();
    //      properties.load(new FileInputStream("/Users/liujian/personal/workspace-lion/lion/lion-api/src/main/filters/config-dev.properties"));
    //      for (Entry<Object, Object> entry : properties.entrySet()) {
    //         System.out.println(entry.getKey() + ": " + entry.getValue());
    //      }/*from   www . j a va2s.  c  o  m*/
}

From source file:com.hadoopvietnam.commons.crypt.J2MECrypto.java

public static void main(String[] args) {
    J2MECrypto crypto = new J2MECrypto("LetfyActionCrypto".getBytes());
    String code = System.currentTimeMillis() + " " + "tk1cntt@gmail.com" + " " + System.currentTimeMillis();
    String encode = new String(Base64.encodeBase64(crypto.encrypt((code).getBytes())));
    System.out.println(encode);/* www.j a  v  a  2 s  .  c o  m*/
    String decode = new String(crypto.decrypt(Base64.decodeBase64(encode.getBytes())));
    System.out.println(decode);
    System.out.println(DigestUtils.md5Hex(code));
}

From source file:com.openthinks.webscheduler.controller.ProfileController.java

public static void main(String[] args) {
    System.out.println(DigestUtils.md5Hex("123456"));
}

From source file:Main.java

public static final String MD5(byte[] bytes) {
    return DigestUtils.md5Hex(bytes);
}