You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
497 B
JavaScript
20 lines
497 B
JavaScript
define([
|
|
'/bower_components/chainpad-crypto/crypto.js'
|
|
], function (Crypto) {
|
|
var common = {};
|
|
|
|
var getSecrets = common.getSecrets = function () {
|
|
var secret = {};
|
|
if (!/#/.test(window.location.href)) {
|
|
secret.key = Crypto.genKey();
|
|
} else {
|
|
var hash = window.location.hash.slice(1);
|
|
secret.channel = hash.slice(0, 32);
|
|
secret.key = hash.slice(32);
|
|
}
|
|
return secret;
|
|
};
|
|
|
|
return common;
|
|
});
|