Fix "sjcl not found" errors in TiddlyDesktop (#8007)
This commit is contained in:
parent
c947ba4310
commit
984863065e
|
@ -786,6 +786,7 @@ $tw.utils.Crypto = function() {
|
||||||
}
|
}
|
||||||
return outputText;
|
return outputText;
|
||||||
};
|
};
|
||||||
|
$tw.sjcl = sjcl;
|
||||||
this.setPassword = function(newPassword) {
|
this.setPassword = function(newPassword) {
|
||||||
currentPassword = newPassword;
|
currentPassword = newPassword;
|
||||||
this.updateCryptoStateTiddler();
|
this.updateCryptoStateTiddler();
|
||||||
|
|
|
@ -16,7 +16,7 @@ exports.sha256 = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [],
|
||||||
length = parseInt(operator.operand,10) || 20,
|
length = parseInt(operator.operand,10) || 20,
|
||||||
sha256 = function(text) {
|
sha256 = function(text) {
|
||||||
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(text)).substr(0,length);
|
return $tw.sjcl.codec.hex.fromBits($tw.sjcl.hash.sha256.hash(text)).substr(0,length);
|
||||||
};
|
};
|
||||||
source(function(tiddler,title) {
|
source(function(tiddler,title) {
|
||||||
results.push(sha256(title));
|
results.push(sha256(title));
|
||||||
|
|
Loading…
Reference in New Issue