0
var s = "ACDEFHJKLMNPQRSTUVWXY012345678";

let charset = { 
"0":"0", 
"1":"1", 
"2":"2", 
"3":"3", 
"4":"4", 
"5":"5", 
"6":"6", 
"7":"7", 
"8":"8", 
"9":"9", 
"A":"10", 
"C":"11", 
"D":"12", 
"E":"13", 
"F":"14", 
"H":"15", 
"J":"16", 
"K":"17", 
"L":"18", 
"M":"19", 
"N":"20", 
"P":"21", 
"Q":"22", 
"R":"23", 
"S":"24", 
"T":"25", 
"U":"26", 
"V":"27", 
"W":"28", 
"X":"29", 
"Y":"30" 
}; 

The task is to generate 7 digit random number using both variable 6 digit from var s and 1 digit from charset. i have to generate 6 digit random number from var s and 1 digit random number from charset then combine them to produce 7 digit number.

lksharma
  • 1
  • 2
  • Welcome to Stack Overflow! Please take the [tour](https://stackoverflow.com/tour), look around, and read through the [Help Center](https://stackoverflow.com/help), in particular [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) If you run into a specific problem, research it thoroughly, search thoroughly here, and if you're still stuck post your code and a description of the problem. Also, remember to include [Minimum, Complete, Verifiable Example](https://stackoverflow.com/help/mcve). People will be glad to help – Andreas Nov 13 '18 at 06:49
  • 1
    check this link https://stackoverflow.com/questions/3970795/how-do-you-create-a-random-string-thats-suitable-for-a-session-id-in-postgresql – Anuraag Veerapaneni Nov 13 '18 at 06:57
  • Possible duplicate of [How do you create a random string that's suitable for a session ID in PostgreSQL?](https://stackoverflow.com/questions/3970795/how-do-you-create-a-random-string-thats-suitable-for-a-session-id-in-postgresql) – dWinder Nov 13 '18 at 06:59

0 Answers0