{"size": 547, "ext": "js", "max_stars_repo_path": "substrate-front-end-template/node_modules/@polkadot/util-crypto/secp256k1/compress.js", "max_stars_repo_name": "bmacer/substrate-private-network", "max_stars_repo_stars_event_min_datetime": "2022-01-05T08:46:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-05T08:46:55.000Z", "max_issues_repo_path": "substrate-front-end-template/node_modules/@polkadot/util-crypto/secp256k1/compress.js", "max_issues_repo_name": "bmacer/substrate-private-network", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "substrate-front-end-template/node_modules/@polkadot/util-crypto/secp256k1/compress.js", "max_forks_repo_name": "bmacer/substrate-private-network", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.1764705882, "max_line_length": 101, "alphanum_fraction": 0.7586837294}
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.secp256k1Compress = secp256k1Compress;

var _util = require("@polkadot/util");

var _secp256k = require("./secp256k1");

// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
function secp256k1Compress(publicKey) {
  (0, _util.assert)([33, 65].includes(publicKey.length), 'Invalid publicKey provided');
  return new Uint8Array(_secp256k.secp256k1.keyFromPublic(publicKey).getPublic().encodeCompressed());
}