fune/browser/extensions/screenshots/webextension/randomString.js
Jared Hirsch 47db4ca0b0 Bug 1361208 - import latest version of Screenshots (6.6.0) into the tree; r=standard8
MozReview-Commit-ID: DICbgINxnoa

--HG--
extra : rebase_source : 065193b99216d68cf7f3ab3a41944f3d2a0836eb
2017-05-01 16:58:23 -07:00

14 lines
380 B
JavaScript

/* exported randomString */
"use strict";
this.randomString = function randomString(length, chars) {
let randomStringChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
chars = chars || randomStringChars;
let result = "";
for (let i = 0; i < length; i++) {
result += chars[Math.floor(Math.random() * chars.length)]
}
return result;
}
null;