File tree 3 files changed +2
-12
lines changed
3 files changed +2
-12
lines changed Original file line number Diff line number Diff line change 64
64
},
65
65
"homepage" : " https://github.com/dcangulo/react-native-pkce-challenge#readme" ,
66
66
"dependencies" : {
67
- "base-64" : " ^1.0.0" ,
68
67
"js-sha256" : " ^0.11.0"
69
68
},
70
69
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
import { sha256 } from 'js-sha256' ;
2
- import base64 from 'base-64' ;
3
2
4
3
const BYTE_LENGTH = 96 ;
5
4
@@ -14,7 +13,7 @@ export function base64UrlEncode(str: string) {
14
13
15
14
export function generateChallenge ( verifier : string ) {
16
15
const digest = sha256 . digest ( verifier ) ;
17
- const hash = base64 . encode ( String . fromCharCode ( ...new Uint8Array ( digest ) ) ) ;
16
+ const hash = btoa ( String . fromCharCode ( ...new Uint8Array ( digest ) ) ) ;
18
17
19
18
return base64UrlEncode ( hash ) ;
20
19
}
@@ -29,7 +28,7 @@ export function getRandomBase64StringFallback(byteLength: number) {
29
28
console . warn ( 'Native getRandomValues function not found. Falling back to insecure Math.random.' ) ;
30
29
31
30
const buffer = new Uint8Array ( byteLength ) . map ( ( ) => Math . floor ( Math . random ( ) * 256 ) ) ;
32
- const bytes = base64 . encode ( String . fromCharCode ( ...new Uint8Array ( buffer ) ) ) ;
31
+ const bytes = btoa ( String . fromCharCode ( ...new Uint8Array ( buffer ) ) ) ;
33
32
34
33
return bytes ;
35
34
}
Original file line number Diff line number Diff line change @@ -4099,13 +4099,6 @@ __metadata:
4099
4099
languageName : node
4100
4100
linkType : hard
4101
4101
4102
- " base-64@npm:^1.0.0 " :
4103
- version : 1.0.0
4104
- resolution : " base-64@npm:1.0.0"
4105
- checksum : d10b64a1fc9b2c5a5f39f1ce1e6c9d1c5b249222bbfa3a0604c592d90623caf74419983feadd8a170f27dc0c3389704f72faafa3e645aeb56bfc030c93ff074a
4106
- languageName : node
4107
- linkType : hard
4108
-
4109
4102
" base64-js@npm:^1.3.1, base64-js@npm:^1.5.1 " :
4110
4103
version : 1.5.1
4111
4104
resolution : " base64-js@npm:1.5.1"
@@ -9730,7 +9723,6 @@ __metadata:
9730
9723
" @react-native/eslint-config " : ^0.73.1
9731
9724
" @types/base-64 " : ^1.0.2
9732
9725
" @types/react " : ^18.2.44
9733
- base-64 : ^1.0.0
9734
9726
commitlint : ^17.0.2
9735
9727
del-cli : ^5.1.0
9736
9728
eslint : ^8.51.0
You can’t perform that action at this time.
0 commit comments