MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / run

Function run

apps/toolbox/src/pages/winter-tc.ts:10–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8}
9
10function run() {
11 console.log(crypto.randomUUID());
12
13 const array = new Uint32Array(10);
14 crypto.getRandomValues(array);
15
16 console.log('Your lucky numbers:');
17 for (const num of array) {
18 console.log(num);
19 }
20
21 const text = 'An obscure body in the S-K System, your majesty. The inhabitants refer to it as the planet Earth.';
22
23 async function digestMessage(message) {
24 const encoder = new TextEncoder();
25 const data = encoder.encode(message);
26 const hash = await crypto.subtle.digest('SHA-256', data);
27 return hash;
28 }
29
30 digestMessage(text).then((digestBuffer) => {
31 console.log(digestBuffer.byteLength);
32 console.log(new Uint8Array(digestBuffer));
33 });
34
35 gen_hmac();
36
37 gen_rsa_oaep();
38}
39
40export function encodeDecode() {
41 const encoded = btoa('Osei');

Callers 1

navigatingToFunction · 0.70

Calls 6

digestMessageFunction · 0.85
gen_hmacFunction · 0.85
gen_rsa_oaepFunction · 0.85
logMethod · 0.45
randomUUIDMethod · 0.45
getRandomValuesMethod · 0.45

Tested by

no test coverage detected