You've already forked joplin
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:
@ -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();
|
||||
|
Reference in New Issue
Block a user