lib/crypto.js
function sign(private_key, data) {
  var key = new bitcoinjs.ECKey(new BigInteger(private_key, 16), false);
  var hash = bitcoinjs.crypto.hash256(new Buffer(data, 'hex'));
  return key.sign(hash).toDER().toString('hex');
}
function sign(private_key, data) {
  var key = new bitcoinjs.ECKey(new BigInteger(private_key, 16), false);
  var hash = bitcoinjs.crypto.hash256(new Buffer(data, 'hex'));
  return key.sign(hash).toDER().toString('hex');
}
function sign ( private_key , data ) { var key = new bitcoinjs . ECKey ( new BigInteger ( private_key , 16 ) , false ) ; var hash = bitcoinjs . crypto . hash256 ( new Buffer ( data , 'hex' ) ) ; return key . sign ( hash ) . toDER ( ) . toString ( 'hex' ) ; }
Sign the given data

** For now assumes ec_secp256k1 **

@param {String} private_key Hex-encoded private key
@param {String} data Hex-encoded data
Sign the given data