17 lines
448 B
17 lines
448 B
// Minimal crypto module implementation for browser using Web Crypto API
|
|
const crypto = {
|
|
...window.crypto,
|
|
// Add any Node.js crypto methods that might be needed
|
|
randomBytes: (size) => {
|
|
const buffer = new Uint8Array(size);
|
|
window.crypto.getRandomValues(buffer);
|
|
return buffer;
|
|
},
|
|
createHash: () => ({
|
|
update: () => ({
|
|
digest: () => new Uint8Array(32), // Return empty hash
|
|
}),
|
|
}),
|
|
};
|
|
|
|
export default crypto;
|
|
|