-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef6ad1c
commit 01aee47
Showing
7 changed files
with
102 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// Since this is a simple function, we can use feature detection to | ||
// see if we are in the nodeJs environment or the browser environment. | ||
export function base64Decode(input: string): Uint8Array { | ||
if (typeof Buffer !== 'undefined') { | ||
if (typeof Buffer !== "undefined") { | ||
// Node.js environment | ||
return Buffer.from(input, 'base64'); | ||
} else if (typeof atob === 'function') { | ||
return Buffer.from(input, "base64"); | ||
} else if (typeof atob === "function") { | ||
// Browser environment | ||
return Uint8Array.from(atob(input), (c) => c.charCodeAt(0)); | ||
} else { | ||
throw new Error('No implementation found for base64 decoding.'); | ||
throw new Error("No implementation found for base64 decoding."); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import * as acvm from '@noir-lang/acvm_js'; | ||
import * as abi from '@noir-lang/noirc_abi'; | ||
import * as acvm from "@noir-lang/acvm_js"; | ||
import * as abi from "@noir-lang/noirc_abi"; | ||
|
||
export { acvm, abi }; | ||
|
||
export { generateWitness } from './witness_generation.js'; | ||
export { acirToUint8Array, witnessMapToUint8Array } from './serialize.js'; | ||
export { generateWitness } from "./witness_generation.js"; | ||
export { acirToUint8Array, witnessMapToUint8Array } from "./serialize.js"; | ||
|
||
export { Noir } from './program.js'; | ||
export { Noir } from "./program.js"; |
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
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
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
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
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