Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function concatSig(v, r, s) {
r = ethUtil.fromSigned(r)
s = ethUtil.fromSigned(s)
v = ethUtil.bufferToInt(v)
r = ethUtil.toUnsigned(r).toString('hex')
s = ethUtil.toUnsigned(s).toString('hex')
v = ethUtil.stripHexPrefix(ethUtil.intToHex(v))
return ethUtil.addHexPrefix(r.concat(s, v).toString("hex"))
}
concatSig: function (v, r, s) {
const rSig = ethUtil.fromSigned(r)
const sSig = ethUtil.fromSigned(s)
const vSig = ethUtil.bufferToInt(v)
const rStr = padWithZeroes(ethUtil.toUnsigned(rSig).toString('hex'), 64)
const sStr = padWithZeroes(ethUtil.toUnsigned(sSig).toString('hex'), 64)
const vStr = ethUtil.stripHexPrefix(ethUtil.intToHex(vSig))
return ethUtil.addHexPrefix(rStr.concat(sStr, vStr)).toString('hex')
},
function concatSig (v, r, s) {
const rSig = ethUtil.fromSigned(r)
const sSig = ethUtil.fromSigned(s)
const vSig = ethUtil.bufferToInt(v)
const rStr = padWithZeroes(ethUtil.toUnsigned(rSig).toString('hex'), 64)
const sStr = padWithZeroes(ethUtil.toUnsigned(sSig).toString('hex'), 64)
const vStr = ethUtil.stripHexPrefix(ethUtil.intToHex(vSig))
return ethUtil.addHexPrefix(rStr.concat(sStr, vStr)).toString('hex')
}
var concatSig = function (signature) {
var v = signature.v;
var r = signature.r;
var s = signature.s;
r = util.fromSigned(r);
s = util.fromSigned(s);
v = util.bufferToInt(v);
r = util.setLengthLeft(util.toUnsigned(r), 32).toString('hex');
s = util.setLengthLeft(util.toUnsigned(s), 32).toString('hex');
v = util.stripHexPrefix(util.intToHex(v));
return util.addHexPrefix(r.concat(s, v).toString("hex"));
};
SGT: function (a, b, runState) {
return Buffer.from([
utils.fromSigned(a).gt(utils.fromSigned(b))
])
},
EQ: function (a, b, runState) {
concatSig: function (v, r, s) {
const rSig = ethUtil.fromSigned(r)
const sSig = ethUtil.fromSigned(s)
const vSig = ethUtil.bufferToInt(v)
const rStr = padWithZeroes(ethUtil.toUnsigned(rSig).toString('hex'), 64)
const sStr = padWithZeroes(ethUtil.toUnsigned(sSig).toString('hex'), 64)
const vStr = ethUtil.stripHexPrefix(ethUtil.intToHex(vSig))
return ethUtil.addHexPrefix(rStr.concat(sStr, vStr)).toString('hex')
},
function concatSig (v, r, s) {
const rSig = ethUtil.fromSigned(r)
const sSig = ethUtil.fromSigned(s)
const vSig = ethUtil.bufferToInt(v)
const rStr = padWithZeroes(ethUtil.toUnsigned(rSig).toString('hex'), 64)
const sStr = padWithZeroes(ethUtil.toUnsigned(sSig).toString('hex'), 64)
const vStr = ethUtil.stripHexPrefix(ethUtil.intToHex(vSig))
return ethUtil.addHexPrefix(rStr.concat(sStr, vStr)).toString('hex')
}
export const concatSig = (v, r, s) => {
const rSig = ethUtil.fromSigned(r);
const sSig = ethUtil.fromSigned(s);
const vSig = ethUtil.bufferToInt(v);
const rStr = padWithZeroes(ethUtil.toUnsigned(rSig).toString('hex'), 64);
const sStr = padWithZeroes(ethUtil.toUnsigned(sSig).toString('hex'), 64);
const vStr = ethUtil.stripHexPrefix(ethUtil.intToHex(vSig));
return ethUtil.addHexPrefix(rStr.concat(sStr, vStr)).toString('hex');
};