commit | author | age | ||
6293d2 | 1 | package com.odcc.cpzidc.common.utils.sms; |
Y | 2 | |
3 | public class SMSCoder { | |
4 | ||
5 | public static String generateCode() { | |
6 | // 生成随机6位码 | |
7 | String s = ""; | |
8 | while (s.length() < 6) { | |
9 | s += (int) (Math.random() * 10); | |
10 | } | |
11 | return s; | |
12 | } | |
13 | ||
14 | public static void main(String args[]) { | |
15 | System.out.println(SMSCoder.generateCode()); | |
16 | } | |
17 | ||
18 | } |