|
|
|
@ -97,8 +97,6 @@ define([
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// FIXME don't spread the functions below across this file and common-hash
|
|
|
|
|
// find a permanent home for these hacks
|
|
|
|
|
var urlSafeB64 = function (u8) {
|
|
|
|
|
return Nacl.util.encodeBase64(u8).replace(/\//g, '-');
|
|
|
|
|
};
|
|
|
|
@ -117,16 +115,6 @@ define([
|
|
|
|
|
return absolute + '#' + symmetric;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Block.createBlockHash = function (href, key) {
|
|
|
|
|
if (typeof(href) !== 'string') { return; }
|
|
|
|
|
if (!(key instanceof Uint8Array)) { return; }
|
|
|
|
|
|
|
|
|
|
try { return href + '#' + Nacl.util.encodeBase64(key); }
|
|
|
|
|
catch (e) { return; }
|
|
|
|
|
};
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
var decodeSafeB64 = function (b64) {
|
|
|
|
|
try {
|
|
|
|
|
return Nacl.util.decodeBase64(b64.replace(/\-/g, '/'));
|
|
|
|
|