Comments (3)
@abhijithvijayan this isn't related to jscu
. it is about jseu
. Please open the issue at the repo.
Also, you should let me know your environment on which you executed the code.
[Addition]
You have a bug in your code:
if you encode an uint8array to base64url here:
export const keyTobase64uri = keyArray => {
return jseu.encoder.encodeBase64Url(keyArray);
};
Then, the following should be a decoder of base64url as well (NOT base64)
export const base64uriToArray = encoded => {
return jseu.encoder.decodeBase64(encoded); // this should be decodeBase64Url
};
from jscu.
file 1
import jseu from 'js-encoding-utils';
export const keyTobase64uri = keyArray => {
return jseu.encoder.encodeBase64Url(keyArray);
};
file 2
const base64EncKeySalt = await keyTobase64uri(encryptionKeySalt);
encryptionKeySalt
being a Uint8Array
from jscu.
Later when I call this
File 3
import jseu from 'js-encoding-utils';
export const base64uriToArray = encoded => {
return jseu.encoder.decodeBase64(encoded);
};
File 4
const encryptionKeySalt = await base64uriToArray(base64EncKeySalt);
I get this error DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
from jscu.
Related Issues (20)
- deno support? HOT 1
- allow usage of (window.)crypto.subtle in service worker HOT 4
- React 17 - Webpack fallback error HOT 3
- New monorepo management tool HOT 2
- Unsupported environment error HOT 4
- Supporting react-native
- Typescript implementation of project HOT 2
- Terminating to support IE11 HOT 3
- Please add 'emailAddress' attribute HOT 2
- How to extract data from TBS Certificate? HOT 3
- Verification of x509 certificate is failed HOT 5
- Need help for migrating Webpack 5.x
- Usage with react native and nodejs HOT 1
- cannot encrypt more than 190 bytes HOT 6
- Problem during installation HOT 1
- Action Required: Fix Renovate Configuration HOT 1
- Error converting DER to JWK HOT 1
- How to display contents of a certificate HOT 1
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jscu.