1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Added methods to get secure random bytes

This commit is contained in:
Laurent Cozic
2017-12-12 17:51:07 +00:00
parent 8a282fd2e1
commit 92b857d83b
11 changed files with 49 additions and 798 deletions

View File

@ -12,6 +12,11 @@ function shimInit() {
shim.FormData = require('form-data');
shim.sjclModule = require('lib/vendor/sjcl.js');
shim.randomBytes = async (count) => {
const buffer = require('crypto').randomBytes(count);
return Array.from(buffer);
}
shim.detectAndSetLocale = function (Setting) {
let locale = process.env.LANG;
if (!locale) locale = defaultLocale();