Skip to content

Commit

Permalink
fixed the problem with the global types not being declared (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
kashbrti authored Nov 25, 2024
1 parent ab4f222 commit 6edc173
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/decoder.nr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use super::defaults::BASE64_PADDING_CHAR;

pub global STANDARD = Base64DecodeBE::new(true);
pub global STANDARD_NO_PAD = Base64DecodeBE::new(false);
pub global URL_SAFE = Base64DecodeBE::base64url(false);
pub global URL_SAFE_WITH_PAD = Base64DecodeBE::base64url(true);
pub global STANDARD: Base64DecodeBE = Base64DecodeBE::new(true);
pub global STANDARD_NO_PAD: Base64DecodeBE = Base64DecodeBE::new(false);
pub global URL_SAFE: Base64DecodeBE = Base64DecodeBE::base64url(false);
pub global URL_SAFE_WITH_PAD: Base64DecodeBE = Base64DecodeBE::base64url(true);

global INVALID_VALUE: u8 = 255;
struct Base64DecodeBE {
Expand Down
8 changes: 4 additions & 4 deletions src/encoder.nr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use super::defaults::BASE64_PADDING_CHAR;

pub global STANDARD = Base64EncodeBE::new(true);
pub global STANDARD_NO_PAD = Base64EncodeBE::new(false);
pub global URL_SAFE = Base64EncodeBE::base64url(false);
pub global URL_SAFE_WITH_PAD = Base64EncodeBE::base64url(true);
pub global STANDARD: Base64EncodeBE = Base64EncodeBE::new(true);
pub global STANDARD_NO_PAD: Base64EncodeBE = Base64EncodeBE::new(false);
pub global URL_SAFE: Base64EncodeBE = Base64EncodeBE::base64url(false);
pub global URL_SAFE_WITH_PAD: Base64EncodeBE = Base64EncodeBE::base64url(true);

struct Base64EncodeBE {
// for some reason, if the lookup table is not defined in a struct, access costs are expensive and ROM tables aren't being used :/
Expand Down

0 comments on commit 6edc173

Please sign in to comment.