how to create random number of 64 bit length like this for example'B8FF5AF858E2746937204FB9C8B102D7ECC50A60B4BA3944AC7A9F3C2DD4C4EF'
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how to create random number of 64 bit length like this for example'B8FF5AF858E2746937204FB9C8B102D7ECC50A60B4BA3944AC7A9F3C2DD4C4EF'
0 commentaires
Réponse acceptée
Guillaume
le 29 Nov 2018
Modifié(e) : Guillaume
le 29 Nov 2018
That number is not 64-bit long. It is 64 hexadecimal characters long, which would be 64*8 = 512 bits!
To create a 64-character random string:
characters = ['0':'9', 'A':'F']; %list of characters allowed in the string
randstring = characters(randi(numel(characters), 1, 64))
Note that it is not possible to store a 512-bit number in base matlab other than as a string.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!