Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private getDefaultImage = () => {
const hash = sha256.create();
hash.update(this.props.data);
const identiconData = new Identicon(
hash.hex(),
this.props.size
).toString();
return `data:image/png;base64,${identiconData}`;
};
function hash(buffer) {
return Buffer.from(sha256.create().update(buffer).array());
}
shepherd.seedToWif = (seed, network, iguana) => {
let bytes;
if (process.argv.indexOf('spvold=true') > -1) {
bytes = buggySha256(seed, { asBytes: true });
} else {
const hash = sha256.create().update(seed);
bytes = hash.array();
}
if (iguana) {
bytes[0] &= 248;
bytes[31] &= 127;
bytes[31] |= 64;
}
const d = bigi.fromBuffer(bytes);
const keyPair = shepherd.isZcash(network) ? new bitcoinZcash.ECPair(d, null, { network: shepherd.getNetworkData(network) }) : new bitcoin.ECPair(d, null, { network: shepherd.getNetworkData(network) });
const keys = {
pub: keyPair.getAddress(),
priv: keyPair.toWIF(),
};
var generateJwtToken = function(httpConfig){
var user = heketiUser;
var secret = heketiSecret;
var hash = sha256.create();
hash.update(httpConfig.method.toUpperCase()+'&'+httpConfig.url);
var now = moment();
var qsh = hash.hex();
var payload = {
iss: user,
iat: now.unix(),
exp: now.add(7, 'days').unix(),
qsh: qsh
}
var token = jwtSimple.encode(payload, secret);
return token;
}
RequestHistoryData(data, callback) //第3方日线历史数据请求
{
data.PreventDefault = true;
var period=data.Self.Period; //获取周期
var symbol=this.Symbol;
var name=this.Name;
var peirodMenu=this.GetPeriodInfo(period)
var type=peirodMenu.Type, min=peirodMenu.Min, count=500;
var startDateTime = moment().format('YYYYMMDDHHmmss');
var hash = sha256.create();
hash.update(API_KEY + this.PairName + type + min + startDateTime + count + SECRET_KEY);
var secretHash = hash.hex();
$.ajax({
url: 'https://bit.zealink.com/api/selectchart',
type: 'post',
data:
{
pairname: this.PairName,
apikey: API_KEY,
type: type,
min: min,
startdatetime: startDateTime,
count: count,
secrethash: secretHash
},
private getDefaultImage = () => {
const hash = sha256.create();
hash.update(this.props.data);
const identiconData = new Identicon(hash.hex(), this.props.size).toString();
return `data:image/png;base64,${identiconData}`;
};