lundi 28 octobre 2019

In Java make random 3byte String [duplicate]

This question already has an answer here:

How do I generate a random 3byte string in Java?

Below is the code I've written in python:

import random

def random_unicode(length):
    random_unicodes = [chr(random.randrange(0x999D)) for _ in range(0, length)] 
    return u"".join(random_unicodes)

I am trying to implement this code in Java.




Aucun commentaire:

Enregistrer un commentaire