How to generate 500 random string keys in matlab?
56 次查看(过去 30 天)
显示 更早的评论
I need to understand on how to generate 500 random strings in matlab. and to generate hash values for the same.
0 个评论
回答(1 个)
Mohammad Sami
2020-6-4
You can use the randi function to generate integers corresponding to the ascii values you want to allow in your random string.
An example to generate a character of length of 100 is as follows.
randomstr = char(randi([33 126],1,100));
6 个评论
Rik
2020-6-9
You pick a function that computes a hash (e.g. the one Mohammad linked), and you provide your char array as the input. Although since you are generating a random string anyway, why don't you generate a random array of 0-9A-F as a stand-in for your hash?
What are you trying to achieve?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!