All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.telesign.Util Maven / Gradle / Ivy

Go to download

The TeleSign Java SDK is a Java library that provides an interface to TeleSign Web Services. TeleSign Web Services conform to the REST Web Service Design Model. Services are exposed as URI-addressable resources through the set of RESTful procedures in our TeleSign REST API.

The newest version!
package com.telesign;

import java.security.SecureRandom;

public class Util {

    private static SecureRandom random = new SecureRandom();

    /**
     * Helper function to generate a random number n digits in length using a system random.
     */
    public static String randomWithNDigits(int n) {

        n = Math.abs(n);

        return String.format("%s", ((int) (Math.pow(10, (n - 1))) + random.nextInt((9 * (int) (Math.pow(10, (n - 1)))))));
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy