feat: initial release of NASG
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export function generateSecret(bytes = 32): string {
|
||||
const arr = new Uint8Array(bytes);
|
||||
crypto.getRandomValues(arr);
|
||||
let bin = "";
|
||||
arr.forEach((b) => (bin += String.fromCharCode(b)));
|
||||
return btoa(bin);
|
||||
}
|
||||
Reference in New Issue
Block a user