-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #446 from MatrixAI/feature-crypto
Updating Crypto to use WebCrypto API and to replace RSA with ECC
- Loading branch information
Showing
406 changed files
with
31,058 additions
and
15,796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
benches/results/basic/buffer_encoding_decoding.chart.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" /> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"></script> | ||
<title>basic.buffer_encoding_decoding</title> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
background: #ddd; | ||
} | ||
|
||
.container { | ||
box-sizing: border-box; | ||
height: 96vh; | ||
width: 96vw; | ||
margin: 2vh 2vw; | ||
resize: both; | ||
overflow: hidden; | ||
padding: 20px; | ||
background: white; | ||
box-shadow: 0 0 15px #aaa; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<canvas id="chart1666662556031" width="16" height="9"></canvas> | ||
</div> | ||
<script> | ||
const format = (num) => { | ||
const [whole, fraction] = String(num).split('.') | ||
const chunked = [] | ||
whole | ||
.split('') | ||
.reverse() | ||
.forEach((char, index) => { | ||
if (index % 3 === 0) { | ||
chunked.unshift([char]) | ||
} else { | ||
chunked[0].unshift(char) | ||
} | ||
}) | ||
|
||
const fractionStr = fraction !== undefined ? '.' + fraction : '' | ||
|
||
return ( | ||
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr | ||
) | ||
} | ||
const ctx1666662556031 = document | ||
.getElementById('chart1666662556031') | ||
.getContext('2d') | ||
const chart1666662556031 = new Chart(ctx1666662556031, { | ||
type: 'bar', | ||
data: { | ||
labels: ["JSON stringify and parse buffer","Base64 encode and decode buffer","Base64url encode and decode buffer"], | ||
datasets: [ | ||
{ | ||
data: [172634,1385074,1327362], | ||
backgroundColor: ["hsl(14.951999999999991, 85%, 55%)","hsl(120, 85%, 55%)","hsl(114.996, 85%, 55%)"], | ||
borderColor: ["hsl(14.951999999999991, 85%, 55%)","hsl(120, 85%, 55%)","hsl(114.996, 85%, 55%)"], | ||
borderWidth: 2, | ||
}, | ||
], | ||
}, | ||
options: { | ||
maintainAspectRatio: false, | ||
plugins: { | ||
title: { | ||
display: true, | ||
text: 'basic.buffer_encoding_decoding', | ||
font: { size: 20 }, | ||
padding: 20, | ||
}, | ||
legend: { | ||
display: false, | ||
}, | ||
tooltip: { | ||
callbacks: { | ||
label: (context) => { | ||
return format(context.parsed.y) + ' ops/s' | ||
}, | ||
}, | ||
displayColors: false, | ||
backgroundColor: '#222222', | ||
padding: 10, | ||
cornerRadius: 5, | ||
intersect: false, | ||
}, | ||
}, | ||
scales: { | ||
x: { | ||
grid: { | ||
color: '#888888', | ||
}, | ||
}, | ||
y: { | ||
title: { | ||
display: true, | ||
text: 'Operations per second', | ||
padding: 10, | ||
}, | ||
grid: { | ||
color: '#888888', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.