Java中获取32位UUID

public class createUUID {  

  public static void main(String[] args) {  

    String uuid = UUID.randomUUID().toString();     //转化为String对象  

    System.out.println(uuid);             //打印UUID 

    uuid = uuid.replace("-", "");                      //因为UUID本身为32位只是生成时多了“-”,所以将它们去点就可  

    System.out.println(uuid);  

  }  

}  

posted @ 2017-12-27 12:46  achnly  阅读(73210)  评论(1编辑  收藏  举报