Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"homepage": "https://github.com/Eppo-exp/js-client-sdk-common#readme",
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/js-base64": "^3.3.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📈

"@types/md5": "^2.3.2",
"@types/semver": "^7.5.6",
"@typescript-eslint/eslint-plugin": "^5.13.0",
Expand All @@ -63,9 +64,9 @@
"webpack-cli": "^4.10.0"
},
"dependencies": {
"js-base64": "^3.7.7",
"md5": "^2.3.0",
"pino": "^8.19.0",
"semver": "^7.5.4",
"universal-base64": "^2.1.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪓

"semver": "^7.5.4"
}
}
6 changes: 3 additions & 3 deletions src/obfuscation.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import base64 = require('js-base64');
import * as md5 from 'md5';
import { decode, encode } from 'universal-base64';

export function getMD5Hash(input: string): string {
return md5(input);
}

export function encodeBase64(input: string) {
return encode(input);
return base64.btoaPolyfill(input);
}

export function decodeBase64(input: string) {
return decode(input);
return base64.atobPolyfill(input);
}
17 changes: 12 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,13 @@
expect "^29.0.0"
pretty-format "^29.0.0"

"@types/js-base64@^3.3.1":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@types/js-base64/-/js-base64-3.3.1.tgz#36c2d6dc126277ea28a4d0599d0cafbf547b51e6"
integrity sha512-Zw33oQNAvDdAN9b0IE5stH0y2MylYvtU7VVTKEJPxhyM2q57CVaNJhtJW258ah24NRtaiA23tptUmVn3dmTKpw==
dependencies:
js-base64 "*"

"@types/jsdom@^20.0.0":
version "20.0.1"
resolved "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz"
Expand Down Expand Up @@ -2934,6 +2941,11 @@ jest@^29.7.0:
import-local "^3.0.2"
jest-cli "^29.7.0"

js-base64@*, js-base64@^3.7.7:
version "3.7.7"
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79"
integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==

js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
Expand Down Expand Up @@ -4105,11 +4117,6 @@ undici-types@~5.26.4:
resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==

universal-base64@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/universal-base64/-/universal-base64-2.1.0.tgz#511af92b3a07340fc2647036045aadb3bedcc320"
integrity sha512-WeOkACVnIXJZr/qlv7++Rl1zuZOHN96v2yS5oleUuv8eJOs5j9M5U3xQEIoWqn1OzIuIcgw0fswxWnUVGDfW6g==

universalify@^0.2.0:
version "0.2.0"
resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz"
Expand Down