承接 nassiry/laravel-encoder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nassiry/laravel-encoder

最新稳定版本:1.0.1

Composer 安装命令:

composer require nassiry/laravel-encoder

包简介

An advanced Laravel encoder package for string & integer encoding and decoding.

README 文档

README

Laravel Encoder Package

Tests Packagist Downloads Packagist Version Laravel PHP License

Header Image

The Laravel Encoder package provides a robust and secure way to encode and decode IDs & Strings using customizable Base encoding mechanisms (Base62). With support for variable-length encoding, mappers for added security, and seamless integration with Laravel, this package is ideal for obfuscating sensitive data or creating URL-safe identifiers.

⚠️ Note: This package is meant for obfuscation, not encryption. Do not use it for storing or transmitting sensitive data securely.

Table Of Contents

  1. Features
  2. Requirements
  3. Installation
  4. Quick Example
  5. Documentation
  6. Why I Built This
  7. Why Base62?
  8. Why Choose This Package?
  9. Contributing
  10. Changelog
  11. License

Features

  • Base Encoding: Supports customizable bases (Base62).
  • Variable-Length Encoding: Allows encoding with custom lengths for obfuscation.
  • Mapper-Based Obfuscation: Adds an extra layer of security by using configurable prime numbers and mappers.
  • Customizable Configuration: Publish the configuration file to override default mappers.
  • Exception Handling: Provides detailed exceptions for invalid inputs.
  • Laravel Integration: Works seamlessly with Laravel’s service container and configuration system.
  • Security: Protects sensitive IDs by ensuring encoded values are not easily reversible without the correct configuration.

Requirements

  • PHP 8.1 or higher
  • Laravel 10 or higher (optional, for Laravel integration)
  • PHP extensions: bcmath, mbstring

Installation

Step 1: Install via Composer

composer require nassiry/laravel-encoder

Quick Example

  • Encode & Decode an ID

use Nassiry\Encoder\Facades\Encoder;

$encoded = Encoder::encodeId(12345);
$decoded = Encoder::decodeId($encoded);

echo $encoded; // Encoded Strings
echo $decoded; // 12345
  • Encode & Decode a String

$encoded = Encoder::encodeString('Hello World');
$decoded = Encoder::decodeString($encoded);

echo $encoded; // Encoded Strings
echo $decoded; // Hello World

Documentation

Laravel Integration

Encode/decode strings and IDs using Laravel container, facades, or dependency injection.

Standalone PHP Usage

Use in any PHP project, no Laravel required.

Configuration

Customize encoding behavior, mappers, and defaults.

Custom Bases

Add your own Base58, Base64, or custom encoders.

Exception Handling

Covers validation, decoding issues, and base errors.

Testing & Contributing

Run the test suite or contribute improvements.

Why I Built This

Laravel's encryption produced long strings, and Base64 needed extra steps to be URL-safe. I wanted a clean, simple way to encode IDs and strings short, URL-safe, and easy to configure. Full Story & Benefits

Why Base62?

Read the Reasoning

Conclusion: Why Choose This Package?

Final Thoughts

Contributing

Feel free to submit issues or pull requests to improve the package. Contributions are welcome! Let’s improve it together!

Changelog

See CHANGELOG for release details.

License

This package is open-source software licensed under the MIT license.

统计信息

  • 总下载量: 351
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固