{"size": 572, "ext": "js", "max_stars_repo_path": "client/src/model/Cryptography/CryptoUtils.js", "max_stars_repo_name": "unyieldinggrace/nanofusion", "max_stars_repo_stars_event_min_datetime": "2020-05-17T14:29:12.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-09T16:00:12.000Z", "max_issues_repo_path": "client/src/model/Cryptography/CryptoUtils.js", "max_issues_repo_name": "unyieldinggrace/nanofusion", "max_issues_repo_issues_event_min_datetime": "2020-05-17T22:24:40.000Z", "max_issues_repo_issues_event_max_datetime": "2020-06-04T00:54:32.000Z", "max_forks_repo_path": "client/src/model/Cryptography/CryptoUtils.js", "max_forks_repo_name": "unyieldinggrace/nanofusion", "max_forks_repo_forks_event_min_datetime": "2022-01-06T11:01:23.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-09T16:00:13.000Z"}
{"max_stars_count": 29, "max_issues_count": 4, "max_forks_count": 2, "avg_line_length": 16.8235294118, "max_line_length": 49, "alphanum_fraction": 0.5821678322}
class CryptoUtils {

	ByteArrayToHex(byteArray) {
		if (!byteArray) {
			return '';
		}

		let hexStr = '';
		for (let i = 0; i < byteArray.length; i++) {
			let hex = (byteArray[i] & 0xff).toString(16);
			hex = hex.length === 1 ? `0${hex}` : hex;
			hexStr += hex;
		}

		return hexStr.toUpperCase();
	}

	HexToByteArray(hexString) {
		if (!hexString) {
			return new Uint8Array();
		}

		const a = [];
		for (let i = 0; i < hexString.length; i += 2) {
			a.push(parseInt(hexString.substr(i, 2), 16));
		}

		return new Uint8Array(a);
	}

}

export default CryptoUtils;
