Gathering detailed insights and metrics for @react-native-oh-tpl/react-native-quick-base64
Gathering detailed insights and metrics for @react-native-oh-tpl/react-native-quick-base64
Gathering detailed insights and metrics for @react-native-oh-tpl/react-native-quick-base64
Gathering detailed insights and metrics for @react-native-oh-tpl/react-native-quick-base64
A fast base64 module for React Native
npm install @react-native-oh-tpl/react-native-quick-base64
Typescript
Module System
Min. Node Version
Node Version
NPM Version
39.7
Supply Chain
54.3
Quality
75.8
Maintenance
50
Vulnerability
94.1
License
TypeScript (47.59%)
C++ (26.62%)
JavaScript (7.36%)
Kotlin (4.53%)
Ruby (4.35%)
Java (3.14%)
Objective-C++ (2.31%)
Swift (2.22%)
CMake (1.66%)
C (0.22%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
408 Stars
116 Commits
28 Forks
3 Watchers
4 Branches
10 Contributors
Updated on Jul 10, 2025
Latest Version
2.1.2-1.0.1
Package Id
@react-native-oh-tpl/react-native-quick-base64@2.1.2-1.0.1
Unpacked Size
83.77 kB
Size
26.73 kB
File Count
37
NPM Version
10.2.4
Node Version
20.11.0
Published on
Nov 12, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
2
模板版本:v0.2.2
react-native-quick-base64
[!TIP] Github 地址
请到三方库的 Releases 发布地址查看配套的版本信息:@react-native-oh-tpl/react-native-quick-base64 Releases,并下载适用版本的 tgz 包。
进入到工程目录并输入以下命令:
[!TIP] # 处替换为 tgz 包的路径
1npm install @react-native-oh-tpl/react-native-quick-base64@file:#
1yarn add @react-native-oh-tpl/react-native-quick-base64@file:#
下面的代码展示了这个库的基本使用场景:
[!WARNING] 使用时 import 的库名不变。
1import { btoa, atob } from 'react-native-quick-base64' 2 3const base64 = btoa('foo') 4const decoded = atob(base64)
本库未带rc.x的版本号是已经适配了 Codegen
,在使用前需要主动执行生成三方库桥接代码,详细请参考 Codegen 使用文档。
目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。
首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 harmony
oh-package.json5
添加 overrides 字段1{ 2 ... 3 "overrides": { 4 "@rnoh/react-native-openharmony" : "./react_native_openharmony" 5 } 6}
目前有两种方法:
方法一:通过 har 包引入(推荐)
[!TIP] har 包位于三方库安装路径的
harmony
文件夹下。
打开 entry/oh-package.json5
,添加以下依赖
1"dependencies": { 2 "@rnoh/react-native-openharmony": "file:../react_native_openharmony", 3 4 "@react-native-oh-tpl/react-native-quick-base64": "file:../../node_modules/@react-native-oh-tpl/react-native-quick-base64/harmony/RNQuickBase64.har" 5 }
点击右上角的 sync
按钮
或者在终端执行:
1cd entry 2ohpm install
方法二:直接链接源码
[!TIP] 如需使用直接链接源码,请参考直接链接源码说明
打开 entry/src/main/cpp/CMakeLists.txt
,添加:
1project(rnapp) 2cmake_minimum_required(VERSION 3.4.1) 3set(CMAKE_SKIP_BUILD_RPATH TRUE) 4set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 5set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") 6+ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") 7set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") 8set(LOG_VERBOSITY_LEVEL 1) 9set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") 10set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") 11set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use 12add_compile_definitions(WITH_HITRACE_SYSTRACE) 13 14add_subdirectory("${RNOH_CPP_DIR}" ./rn) 15 16# RNOH_BEGIN: manual_package_linking_1 17add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) 18+ add_subdirectory("${OH_MODULE_DIR}/@react-native-oh-tpl/react-native-quick-base64/src/main/cpp" ./RNQuickBase64) 19# RNOH_END: manual_package_linking_1 20 21file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") 22 23add_library(rnoh_app SHARED 24 ${GENERATED_CPP_FILES} 25 "./PackageProvider.cpp" 26 "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" 27) 28target_link_libraries(rnoh_app PUBLIC rnoh) 29 30# RNOH_BEGIN: manual_package_linking_2 31target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) 32+ target_link_libraries(rnoh_app PUBLIC rnoh_quick_base64) 33# RNOH_END: manual_package_linking_2
打开 entry/src/main/cpp/PackageProvider.cpp
,添加:
1#include "RNOH/PackageProvider.h" 2#include "SamplePackage.h" 3+ #include "RNQuickBase64Package.h" 4 5using namespace rnoh; 6 7std::vector<std::shared_ptr<Package>> PackageProvider::getPackages(Package::Context ctx) { 8 return { 9 std::make_shared<SamplePackage>(ctx), 10+ std::make_shared<RNQuickBase64Package>(ctx) 11 }; 12}
打开 entry/src/main/ets/RNPackagesFactory.ts
,添加:
1+ import { RNQuickBase64Package } from '@react-native-oh-tpl/react-native-quick-base64/ts'; 2 3export function createRNPackages(ctx: RNPackageContext): RNPackage[] { 4 return [ 5 new SamplePackage(ctx), 6+ new RNQuickBase64Package(ctx), 7 ]; 8}
点击右上角的 sync
按钮
或者在终端执行:
1cd entry 2ohpm install
然后编译、运行即可。
要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:@react-native-oh-tpl/react-native-quick-base64 Releases
[!TIP] 官方文档
以下是提供给 onGestureEvent
和 onHandlerStateChange
回调的通用事件数据:
[!tip] "Platform"列表示该属性在原三方库上支持的平台。
[!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
NAME | Description | TYPE | Platform | HarmonyOS Support |
---|---|---|---|---|
btoa | Encodes a string in base64. | Function | All | yes |
atob | Decodes a base64 encoded string. | Function | All | yes |
toByteArray | Takes a base64 string and returns a byte array. Optional removeLinebreaks removes all \n characters. | Function | All | yes |
byteLength | Takes a base64 string and returns length of byte array. | Function | All | yes |
fromByteArray | Takes a byte array and returns a base64 string. Optional urlSafe flag true will use the URL-safe dictionary. | Function | All | yes |
shim | Adds btoa and atob functions to global . | Function | All | yes |
trimBase64Padding | Trims the = padding character(s) off of the end of a base64 encoded string. Also, for base64url encoded strings, it will trim off the trailing . character(s). | Function | All | yes |
getNative | Obtain the native base64ToArrayBuffer and base64FromArrayBuffer functions. | Function | All | yes |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT by Takuya Matsuyama
本项目基于 The MIT License (MIT) ,请自由地享受和参与开源。
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
22 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
2 existing vulnerabilities detected
Details
Reason
Found 3/8 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More