Here you can find the source of encryptURID(long registrationId)
Parameter | Description |
---|---|
registrationId | a parameter |
public static String encryptURID(long registrationId)
//package com.java2s; //License from project: Apache License public class Main { private static final int M_FACTOR = 3; private static final int S_FACTOR = 7; /**//from w w w . j a va2s . c o m * Method encrypt URID * @param registrationId * @return encrypted URID */ public static String encryptURID(long registrationId) { char[] characters = String.valueOf(registrationId).toCharArray(); StringBuilder encryptedURID = new StringBuilder(); for (int index = 0; index < characters.length; index++) { int code = characters[index]; char ch = (char) ((code * M_FACTOR) - S_FACTOR); encryptedURID.append(Integer.toHexString(ch)); if ((index + 1) % 4 == 0) { encryptedURID.append("-"); } } return encryptedURID.toString(); } }