पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv2.2.0

base32

Dart के लिए Base32 एन्कोडर और डीकोडर, मुख्य रूप से एक बार के पासवर्ड सीक्रेट्स के लिए उपयोग किया जाता है।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
1.8 लाख
लाइक
29
Pub अंक
160

पैकेज इंस्टॉल करें

flutter pub add base32

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

Base32 एल्गोरिदम का उपयोग करके डेटा को संकोड़न और डीकोड करने के लिए एक Dart पैकेज, जिसका उपयोग एक बार के पासवर्ड (OTP) सीक्रेट्स को सुरक्षित रूप से हैंडल करने के लिए डिज़ाइन किया गया है। इसमें RFC 4648 में परिभाषित मानक Base32 समर्थन शामिल है, जिससे प्लेटफॉर्म के बीच संगतता सुनिश्चित होती है। पैकेज हल्का और कुशल है, जो बाइनरी डेटा के सुरक्षित, मानव-पठनीय प्रतिनिधित्व की आवश्यकता वाले एप्लिकेशन के लिए आदर्श है। यह Android, iOS, Web, macOS, Windows और Linux सहित सभी प्रमुख प्लेटफॉर्म पर बिना किसी समस्या के काम करता है।

उपयोग

  • OTP गुप्तांक उत्पन्न करना
  • सुरक्षित डेटा कोडिंग
  • क्रॉस-प्लेटफ़ॉर्म टोकन हैंडलिंग
  • पाठ भंडारण के लिए बाइनरी डेटा को संकोडित करना
  • Google Authenticator जैसे OTP ऐप्स के साथ अंतरक्रिया

मुख्य विशेषताएँ

  • RFC 4648 के अनुरूप
  • संकोडन और डीकोडिंग दोनों का समर्थन करता है
  • हल्का और तेज़
  • क्रॉस-प्लेटफॉर्म संगतता
  • OTP एकीकरण के लिए सरल API

इनके लिए उपयुक्त

  • दो-कारक सत्यापन ऐप
  • सुरक्षित प्रमाणपत्र भंडारण
  • Base32 की आवश्यकता वाले मोबाइल और वेब एप्लिकेशन
  • OTP प्रोटोकॉल के साथ काम कर रहे विकासकर्ता
  • मानकीकृत पाठ-आधारित कोडिंग की आवश्यकता वाले अनुप्रयोग

विचार योग्य बातें

  • सामान्य उद्देश्य के लिए एन्क्रिप्शन के लिए उपयुक्त नहीं
  • गोपनीय सुरक्षा के लिए हस्तचालित प्रबंधन की आवश्यकता है
  • केवल Base32 तक सीमित, कोई अन्य संकोडन नहीं
  • गलत इनपुट के लिए कोई निर्मित त्रुटि पुनर्स्थापन नहीं है
  • अतिरिक्त सुरक्षा उपायों के साथ सबसे अच्छा उपयोग किया जाता है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Dart

dart-base32

Simple base32 encode/decode following RFC4648. Can handle base32 for OTP secrets also.

Features:

Getting Started

Pubspec

pub.dev: (you can use 'any' instead of a version if you just want the latest always)

dependencies:
  base32: 2.1.3
import 'package:base32/base32.dart';

Start encoding/decoding ...

// Encode a hex string to base32
base32.encodeHexString('48656c6c6f21deadbeef'); // -> 'JBSWY3DPEHPK3PXP'

// base32 decoding to original string.
base32.decodeAsHexString("JBSWY3DPEHPK3PXP"); // -> '48656c6c6f21deadbeef'

API

base32.encode(List<int> byteList, {Encoding encoding = Encoding.standardRFC4648})

Generate and return a RFC4648 base32 string from a list of bytes.

  • byteList - (List<int>) A list of bytes representing your input.

Returns String representation of the encoded base32.

base32.encodeHexString(String hex, {Encoding encoding = Encoding.standardRFC4648})

Generate and return a RFC4648 base32 string from a hex string.

  • hexString - (String) A string of hex values intended to be converted to bytes and encoded.

Returns String representation of the encoded base32

Example: Encode a hex string.

base32.encodeHexString('48656c6c6f21deadbeef'); // -> 'JBSWY3DPEHPK3PXP'
base32.encodeString(String base32str, {Encoding encoding = Encoding.standardRFC4648})

Generate and return a RFC4648 base32 string from a plain string.

  • base32str - (String) A string intended to be converted to bytes and encoded.

Returns String representation of the encoded base32

Example: Encode a hex string.

base32.encodeString('foobar'); // -> 'MZXW6YTBOI======'
base32.decode(String base32, {Encoding encoding = Encoding.standardRFC4648})

Decodes a base32 string back to its original byte values.

  • base32 - (String) The base32 string you wish to decode.

Returns Uint8List of the decoded data.

Example: Decode a base32 string, then output it in hex format

import "package:convert/convert.dart"
var decoded = base32.decode("JBSWY3DPEHPK3PXP");
var decodedHex = hex.encode(decoded); // -> '48656c6c6f21deadbeef'
base32.decodeAsHexString(String base32, {Encoding encoding = Encoding.standardRFC4648})

Decodes a base32 string back to its original byte values in hex string format.

  • base32 - (String) The base32 string you wish to decode.

Returns String of the decoded data.

Example: Decode a base32 string to a hex string.

import "package:convert/convert.dart"
var decoded = base32.decodeAsHexString("JBSWY3DPEHPK3PXP"); // -> '48656c6c6f21deadbeef'
base32.decodeAsString(String base32, {Encoding encoding = Encoding.standardRFC4648})

Decodes a base32 string back to its original byte values.

  • base32 - (String) The base32 string you wish to decode.

Returns String of the decoded data.

Example: Decode a base32 string to a string.

var decoded = base32.decodeAsString("MZXW6YTBOI======"); // -> 'foobar'
enum Encoding

This is a list of supported variants and their different encodings.

  • StandardRFC4648 - the default standard encoding
    • ABCDEFGHIJKLMNOPQRSTUVWXYZ234567
    • Padded with =
  • base32Hex
    • 0123456789ABCDEFGHIJKLMNOPQRSTUV
    • Padded with =
  • crockford
    • 0123456789ABCDEFGHJKMNPQRSTVWXYZ
    • Not Padded
  • z-base-32
    • ybndrfg8ejkmcpqxot1uwisza345h769
    • Not Padded
  • geohash
    • 0123456789bcdefghjkmnpqrstuvwxyz
    • Padded with =
  • NonStandardRFC4648 - Same as StandardRFC4648, but lowercase, not supported by the spec.
    • abcdefghijklmnopqrstuvwxyz234567
    • Padded with =

Testing

dart test/base32_test.dart

Changelog

See CHANGELOG.md

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट