javascript - How to generate 4 digits alphanumeric code in meteor? -
How to specify Generate alphanumeric code with 4 digits with recurrence? You ask 4 points, but also say 'alphanumeric'. Either way: This is not a meteorite-specific, it can be used in any JavaScript app. For Alphanumeric we have a Will take the shortcut and
generated function 4DigitNonRepeatingNumericCode () {ret = ""; While (ret.length & lt; 4) {var pickanumberBetween0 and 9 = ("+++ Math.random ()). CharAt (2); if (ret.indexOf (" + + pickanumberBetween0 and 9) == -1) Rate + = Picanambar Between 0 and 9;} Return Return;}
Meteor.Collection.ObjectID :
generated function of the meteor 4CharacterNonRepeatingAlphanumericCode () {ret = ""; while (ret.length> 4) { var pickACharacter = ("new meteorite" compilation. objectIDID () .hexString ()). (0); if (ret.indexOf ("+ pickacharacter) == -1) Rate + = Pakacrocessor; } Return return; }
Comments
Post a Comment