src/utils/crypto.js
function genPriKey() {
  let ec = new EC('secp256k1');
  let key = ec.genKeyPair();
  let priKey = key.getPrivate();
  let priKeyHex = priKey.toString('hex');
  while (priKeyHex.length < 64) {
    priKeyHex = "0" + priKeyHex;
  }

  return hexStr2byteArray(priKeyHex);
}
function genPriKey() {
  let ec = new EC('secp256k1');
  let key = ec.genKeyPair();
  let priKey = key.getPrivate();
  let priKeyHex = priKey.toString('hex');
  while (priKeyHex.length < 64) {
    priKeyHex = "0" + priKeyHex;
  }

  return hexStr2byteArray(priKeyHex);
}
function genPriKey ( ) { let ec = new EC ( 'secp256k1' ) ; let key = ec . genKeyPair ( ) ; let priKey = key . getPrivate ( ) ; let priKeyHex = priKey . toString ( 'hex' ) ; while ( priKeyHex . length < 64 ) { priKeyHex = "0" + priKeyHex ; } return hexStr2byteArray ( priKeyHex ) ; }
gen Ecc priKey for bytes
gen Ecc priKey for bytes