react native random string hash code example
Example 1: react native get numeric random string length of 5 characters
function randomString(length, chars) {
var result = '';
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
return result;
}
var rString = randomString(32, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
Example 2: random string js
const string_length = 10
[...Array(string_length)].map(i=>(~~(Math.random()*36)).toString(36)).join('')